diff --git a/llvm/lib/CheerpUtils/AllocaLowering.cpp b/llvm/lib/CheerpUtils/AllocaLowering.cpp index 345f72f6f552..ed5097bc83cc 100644 --- a/llvm/lib/CheerpUtils/AllocaLowering.cpp +++ b/llvm/lib/CheerpUtils/AllocaLowering.cpp @@ -308,6 +308,7 @@ PreservedAnalyses cheerp::AllocaLoweringInnerPass::run(Function& F, FunctionAnal PA.preserve(); PA.preserve(); PA.preserve(); + PA.preserve(); return PA; } diff --git a/llvm/lib/Target/CheerpBackend/CheerpWritePass.cpp b/llvm/lib/Target/CheerpBackend/CheerpWritePass.cpp index 38a0703efb0e..c5983c8304d9 100644 --- a/llvm/lib/Target/CheerpBackend/CheerpWritePass.cpp +++ b/llvm/lib/Target/CheerpBackend/CheerpWritePass.cpp @@ -249,9 +249,9 @@ bool CheerpWritePass::runOnModule(Module& M) MPM.addPass(cheerp::FreeAndDeleteRemovalPass()); MPM.addPass(cheerp::GlobalDepsAnalyzerPass(mathMode, /*resolveAliases*/true)); + MPM.addPass(cheerp::InvokeWrappingPass()); if (isWasmTarget) MPM.addPass(cheerp::AllocaLoweringPass()); - MPM.addPass(cheerp::InvokeWrappingPass()); MPM.addPass(cheerp::FFIWrappingPass()); MPM.addPass(createModuleToFunctionPassAdaptor(cheerp::FixIrreducibleControlFlowPass())); MPM.addPass(createModuleToFunctionPassAdaptor(cheerp::PointerArithmeticToArrayIndexingPass()));