diff options
author | Derek Schuff <dschuff@chromium.org> | 2024-12-06 12:34:19 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-06 20:34:19 +0000 |
commit | 729ea41d145d369b203dca6f70b251ea365cb3d0 (patch) | |
tree | 269217c2d17d6e8a4a59eb6b822aa4cdac17aa28 /src/passes | |
parent | 3f82ffc70362bf967d91d3cb56ee4c8c5ebe1161 (diff) | |
download | binaryen-729ea41d145d369b203dca6f70b251ea365cb3d0.tar.gz binaryen-729ea41d145d369b203dca6f70b251ea365cb3d0.tar.bz2 binaryen-729ea41d145d369b203dca6f70b251ea365cb3d0.zip |
Add bulk-memory-opt feature and ignore call-indirect-overlong (#7139)
LLVM recently split the bulk-memory-opt feature out from bulk-memory,
containing just memory.copy and memory.fill. This change follows that,
making bulk-memory-opt also enabled when all of bulk-memory is enabled.
It also introduces call-indirect-overlong following LLVM, but ignores
it, since Binaryen has always allowed the encoding (i.e. command
line flags enabling or disabling the feature are accepted but
ignored).
Diffstat (limited to 'src/passes')
-rw-r--r-- | src/passes/LLVMMemoryCopyFillLowering.cpp | 4 | ||||
-rw-r--r-- | src/passes/OptimizeInstructions.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/passes/LLVMMemoryCopyFillLowering.cpp b/src/passes/LLVMMemoryCopyFillLowering.cpp index e5b940a5a..d2a7e5c48 100644 --- a/src/passes/LLVMMemoryCopyFillLowering.cpp +++ b/src/passes/LLVMMemoryCopyFillLowering.cpp @@ -49,7 +49,7 @@ struct LLVMMemoryCopyFillLowering } void run(Module* module) override { - if (!module->features.hasBulkMemory()) { + if (!module->features.hasBulkMemoryOpt()) { return; } if (module->features.hasMemory64() || module->features.hasMultiMemory()) { @@ -108,7 +108,7 @@ struct LLVMMemoryCopyFillLowering } else { module->removeFunction(memFillFuncName); } - module->features.disable(FeatureSet::BulkMemory); + module->features.setBulkMemoryOpt(false); } void createMemoryCopyFunc(Module* module) { diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 881b7ea1f..792cf6235 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -1275,7 +1275,7 @@ struct OptimizeInstructions if (curr->type == Type::unreachable) { return; } - assert(getModule()->features.hasBulkMemory()); + assert(getModule()->features.hasBulkMemoryOpt()); if (auto* ret = optimizeMemoryCopy(curr)) { return replaceCurrent(ret); } @@ -1285,7 +1285,7 @@ struct OptimizeInstructions if (curr->type == Type::unreachable) { return; } - assert(getModule()->features.hasBulkMemory()); + assert(getModule()->features.hasBulkMemoryOpt()); if (auto* ret = optimizeMemoryFill(curr)) { return replaceCurrent(ret); } |