summaryrefslogtreecommitdiff
path: root/src/passes/Memory64Lowering.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename indexType -> addressType. NFC (#7060)Sam Clegg2024-11-071-1/+1
| | | See https://github.com/WebAssembly/memory64/pull/92
* [NFC] Standardize Super:: over super:: (#6920)Alon Zakai2024-09-101-1/+1
| | | | As the name of a class, uppercase seems better here.
* Memory64Lowering: Handle -1 return value from memory.grow (#6733)Sam Clegg2024-07-111-2/+25
| | | This edge case make the lowering a little more tricky.
* [Memory64Lowering/Table64Lowering] Avoid dependency in visitation order. ↵Sam Clegg2024-05-161-15/+11
| | | | | NFC (#6600) Followup to #6599.
* [Table64Lowering] Don't assume that all segments are from 64-bit tables (#6599)Sam Clegg2024-05-161-3/+9
| | | | | | | | | This allows modules to contains both 32-bit and 64-bit segment. In order to check the table/memory state when visiting segments we need to ensure that memories/tables are visited only after their segments. The comments in visitTable/visitMemory already assumed this but it wasn't true in practice.
* Add table64 lowering pass (#6595)Sam Clegg2024-05-151-36/+39
| | | | | Changes to wasm-validator.cpp here are mostly for consistency between elem and data segment validation.
* Remove redundant ptrType from MemorySize/Grow instructions. NFC (#6590)Sam Clegg2024-05-151-2/+2
| | | | I recently add TableSize/Grow and noticed I didn't need these. It seems they are superfluous.
* Disable the memory64 feature in Memory64Lowering.cpp (#5679)Thomas Lively2023-04-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Disable sign extension in SignExtLowering.cpp The sign extension lowering pass would previously lower away the sign extension instructions, but it wouldn't disable the sign extension feature, so follow-on passes such as optimize-instructions could reintroduce sign extension instructions. Fix the pass to disable the sign extension feature to prevent sign extension instructions from being reintroduced later. * update pass description * Disable the memory64 feature in Memory64Lowering.cpp For consistency with other feature lowering passes, disable memory64 in addition to lowering its use away. Although no other passes would introduce new uses of memory64 at the moment, this makes the lowering pass more robust against a future where memory64 might accidentally be reintroduced after being lowered away. * Update test/lit/passes/memory64-lowering-features.wast Co-authored-by: Alon Zakai <azakai@google.com> --------- Co-authored-by: Alon Zakai <azakai@google.com>
* Memory64Lowering: Ignore data segments with non-const iniital offset (#5074)Sam Clegg2022-09-281-3/+31
| | | | This is the case for dynamic linking where the segment offset are derived from he `__memory_base` import.
* Fix Memory64 binary parsing after #4811 (#4933)Alon Zakai2022-08-181-4/+0
| | | | Due to missing test coverage, we missed in #4811 that some memory operations needed to get make64() called on them.
* Mutli-Memories Support in IR (#4811)Ashley Nelson2022-08-171-38/+60
| | | | | | | This PR removes the single memory restriction in IR, adding support for a single module to reference multiple memories. To support this change, a new memory name field was added to 13 memory instructions in order to identify the memory for the instruction. It is a goal of this PR to maintain backwards compatibility with existing text and binary wasm modules, so memory indexes remain optional for memory instructions. Similarly, the JS API makes assumptions about which memory is intended when only one memory is present in the module. Another goal of this PR is that existing tests behavior be unaffected. That said, tests must now explicitly define a memory before invoking memory instructions or exporting a memory, and memory names are now printed for each memory instruction in the text format. There remain quite a few places where a hardcoded reference to the first memory persist (memory flattening, for example, will return early if more than one memory is present in the module). Many of these call-sites, particularly within passes, will require us to rethink how the optimization works in a multi-memories world. Other call-sites may necessitate more invasive code restructuring to fully convert away from relying on a globally available, single memory pointer.
* First class Data Segments (#4733)Ashley Nelson2022-06-211-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Updating wasm.h/cpp for DataSegments * Updating wasm-binary.h/cpp for DataSegments * Removed link from Memory to DataSegments and updated module-utils, Metrics and wasm-traversal * checking isPassive when copying data segments to know whether to construct the data segment with an offset or not * Removing memory member var from DataSegment class as there is only one memory rn. Updated wasm-validator.cpp * Updated wasm-interpreter * First look at updating Passes * Updated wasm-s-parser * Updated files in src/ir * Updating tools files * Last pass on src files before building * added visitDataSegment * Fixing build errors * Data segments need a name * fixing var name * ran clang-format * Ensuring a name on DataSegment * Ensuring more datasegments have names * Adding explicit name support * Fix fuzzing name * Outputting data name in wasm binary only if explicit * Checking temp dataSegments vector to validateBinary because it's the one with the segments before we processNames * Pass on when data segment names are explicitly set * Ran auto_update_tests.py and check.py, success all around * Removed an errant semi-colon and corrected a counter. Everything still passes * Linting * Fixing processing memory names after parsed from binary * Updating the test from the last fix * Correcting error comment * Impl kripken@ comments * Impl tlively@ comments * Updated tests that remove data print when == 0 * Ran clang format * Impl tlively@ comments * Ran clang-format
* [Memory64] Fixed atomics / bulk memory support. (#3992)Wouter van Oortmerssen2021-07-191-3/+13
|
* [Memory64] further memory limit fixes (#3865)Wouter van Oortmerssen2021-07-091-0/+3
| | | That were somehow missed.. triggered by emscripten tests
* Support 64-bit data segment init-exps in Memory64 (#3593)Wouter van Oortmerssen2021-02-251-0/+5
| | | This as a consequence of https://reviews.llvm.org/D95651
* [Memory64] (#3302)Wouter van Oortmerssen2020-10-301-12/+26
| | | Fixed bug in memory64-lowering pass for memory.size/grow
* Added Initial Memory64Lowering pass (#3230)Wouter van Oortmerssen2020-10-131-0/+87
This pass will convert a module with 64-bit loads and stores accessing a 64-bit memory to a regular 32-bit one. Pointers remain 64-bit but are truncated just before use.