diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/SignExtLowering.cpp | 8 | ||||
-rw-r--r-- | src/passes/pass.cpp | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/passes/SignExtLowering.cpp b/src/passes/SignExtLowering.cpp index 7d03046ea..beb36494f 100644 --- a/src/passes/SignExtLowering.cpp +++ b/src/passes/SignExtLowering.cpp @@ -68,6 +68,14 @@ struct SignExtLowering : public WalkerPass<PostWalker<SignExtLowering>> { } } } + + void run(Module* module) override { + if (!module->features.has(FeatureSet::SignExt)) { + return; + } + super::run(module); + module->features.disable(FeatureSet::SignExt); + } }; Pass* createSignExtLoweringPass() { return new SignExtLowering(); } diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index d567fee95..ff2c7d45f 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -408,7 +408,8 @@ void PassRegistry::registerPasses() { "apply more specific subtypes to signature types where possible", createSignatureRefiningPass); registerPass("signext-lowering", - "lower sign-ext operations to wasm mvp", + "lower sign-ext operations to wasm mvp and disable the sign " + "extension feature", createSignExtLoweringPass); registerPass("simplify-globals", "miscellaneous globals-related optimizations", |