From 7cd2396dacf276750a3e27320d6b9d2af6f939d9 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 19 Apr 2023 16:56:53 -0700 Subject: Disable the memory64 feature in Memory64Lowering.cpp (#5679) * 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 * Disable the memory64 feature in Memory64Lowering.cpp For consistency with other feature lowering passes, disable memory64 in addition to lowering its use away. Although no other passes would introduce new uses of memory64 at the moment, this makes the lowering pass more robust against a future where memory64 might accidentally be reintroduced after being lowered away. * Update test/lit/passes/memory64-lowering-features.wast Co-authored-by: Alon Zakai --------- Co-authored-by: Alon Zakai --- src/passes/Memory64Lowering.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/passes/Memory64Lowering.cpp b/src/passes/Memory64Lowering.cpp index 661d6cdae..194d593d8 100644 --- a/src/passes/Memory64Lowering.cpp +++ b/src/passes/Memory64Lowering.cpp @@ -159,6 +159,14 @@ struct Memory64Lowering : public WalkerPass> { } } } + + void run(Module* module) override { + if (!module->features.has(FeatureSet::Memory64)) { + return; + } + super::run(module); + module->features.disable(FeatureSet::Memory64); + } }; Pass* createMemory64LoweringPass() { return new Memory64Lowering(); } -- cgit v1.2.3