diff options
author | Thomas Lively <tlively@google.com> | 2023-03-29 17:10:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-29 17:10:08 -0700 |
commit | dba0a08963d0452a773b9abbdd789503945c5f43 (patch) | |
tree | 79b819b0ac00e0cbf248cd2100a2763dd7f72acb /src | |
parent | 122f7b578c6c3887924d820b714bbd2d2c921390 (diff) | |
download | binaryen-dba0a08963d0452a773b9abbdd789503945c5f43.tar.gz binaryen-dba0a08963d0452a773b9abbdd789503945c5f43.tar.bz2 binaryen-dba0a08963d0452a773b9abbdd789503945c5f43.zip |
Do not treat `atomic.fence` as using a memory (#5603)
* Do not treat `atomic.fence` as using a memory
Update RemoveUnusedModuleElements so that it no longer keeps the memory alive
due to an `atomic.fence` instruction and update validation to allow modules to
use `atomic.fence` without a memory.
* update wasm2js tests
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/RemoveUnusedModuleElements.cpp | 1 | ||||
-rw-r--r-- | src/wasm/wasm-validator.cpp | 2 |
2 files changed, 0 insertions, 3 deletions
diff --git a/src/passes/RemoveUnusedModuleElements.cpp b/src/passes/RemoveUnusedModuleElements.cpp index 6ad804e0b..103be5e4a 100644 --- a/src/passes/RemoveUnusedModuleElements.cpp +++ b/src/passes/RemoveUnusedModuleElements.cpp @@ -138,7 +138,6 @@ struct ReferenceFinder : public PostWalker<ReferenceFinder> { void visitAtomicRMW(AtomicRMW* curr) { usesMemory = true; } void visitAtomicWait(AtomicWait* curr) { usesMemory = true; } void visitAtomicNotify(AtomicNotify* curr) { usesMemory = true; } - void visitAtomicFence(AtomicFence* curr) { usesMemory = true; } void visitMemoryInit(MemoryInit* curr) { usesMemory = true; } void visitDataDrop(DataDrop* curr) { // TODO: Replace this with a use of a data segment (#5224). diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index 123a15c1e..8abcd92fe 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1172,8 +1172,6 @@ void FunctionValidator::visitAtomicNotify(AtomicNotify* curr) { } void FunctionValidator::visitAtomicFence(AtomicFence* curr) { - shouldBeFalse( - getModule()->memories.empty(), curr, "Memory operations require a memory"); shouldBeTrue(getModule()->features.hasAtomics(), curr, "Atomic operations require threads [--enable-threads]"); |