diff options
author | Thomas Lively <tlively@google.com> | 2023-04-19 16:56:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 16:56:42 -0700 |
commit | 1e2e89b26fa27f51c4ae85e59dd081e352bf8f7c (patch) | |
tree | 665f6442cc00bcf747761ba46fc6284dea29e8a7 /src/passes/SignExtLowering.cpp | |
parent | 8e965ee29a12ce6d5ba2d2fc5d8a51b75b42ad73 (diff) | |
download | binaryen-1e2e89b26fa27f51c4ae85e59dd081e352bf8f7c.tar.gz binaryen-1e2e89b26fa27f51c4ae85e59dd081e352bf8f7c.tar.bz2 binaryen-1e2e89b26fa27f51c4ae85e59dd081e352bf8f7c.zip |
Disable sign extension in SignExtLowering.cpp (#5676)
* 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
Diffstat (limited to 'src/passes/SignExtLowering.cpp')
-rw-r--r-- | src/passes/SignExtLowering.cpp | 8 |
1 files changed, 8 insertions, 0 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(); } |