diff options
author | Ashley Nelson <nashley@google.com> | 2022-11-01 12:16:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-01 12:16:16 -0700 |
commit | 5892f493706558a95d57b3731014b400fd832d70 (patch) | |
tree | 43772fdb2ee7f59f29c0043ab29414946b9cfa43 /src/passes/pass.cpp | |
parent | 288a12645d060d8f2ec97b13b5795cd53a8a7811 (diff) | |
download | binaryen-5892f493706558a95d57b3731014b400fd832d70.tar.gz binaryen-5892f493706558a95d57b3731014b400fd832d70.tar.bz2 binaryen-5892f493706558a95d57b3731014b400fd832d70.zip |
Multi-Memories Lowering Pass (#5107)
Adds a multi-memories lowering pass that will create a single combined memory from the memories added to the module. This pass assumes that each memory is configured the same (type, shared).
This pass also:
- replaces existing memory.size instructions with a custom function that returns the size of each memory as if they existed independently
- replaces existing memory.grow instructions with a custom function, using global offsets to track the page size of each memory so data doesn't overlap in the singled combined memory
- adjusts the offsets of active data segments
- adjusts the offsets of Loads/Stores
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r-- | src/passes/pass.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index ae9f34584..c6d94ddf7 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -272,6 +272,9 @@ void PassRegistry::registerPasses() { registerPass("mod-asyncify-never-unwind", "apply the assumption that asyncify never unwinds", createModAsyncifyNeverUnwindPass); + registerPass("multi-memory-lowering", + "combines multiple memories into a single memory", + createMultiMemoryLoweringPass); registerPass("nm", "name list", createNameListPass); registerPass("name-types", "(re)name all heap types", createNameTypesPass); registerPass("once-reduction", |