[llvm] r258127 - [WebAssembly] Disable some WebAssembly-specific optimization passes at -O0.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 06:55:02 PST 2016
Author: djg
Date: Tue Jan 19 08:55:02 2016
New Revision: 258127
URL: http://llvm.org/viewvc/llvm-project?rev=258127&view=rev
Log:
[WebAssembly] Disable some WebAssembly-specific optimization passes at -O0.
Modified:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp?rev=258127&r1=258126&r2=258127&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp Tue Jan 19 08:55:02 2016
@@ -140,7 +140,8 @@ void WebAssemblyPassConfig::addIRPasses(
addPass(createAtomicExpandPass(TM));
// Optimize "returned" function attributes.
- addPass(createWebAssemblyOptimizeReturned());
+ if (getOptLevel() != CodeGenOpt::None)
+ addPass(createWebAssemblyOptimizeReturned());
TargetPassConfig::addIRPasses();
}
@@ -165,7 +166,8 @@ void WebAssemblyPassConfig::addPreRegAll
TargetPassConfig::addPreRegAlloc();
// Prepare store instructions for register stackifying.
- addPass(createWebAssemblyStoreResults());
+ if (getOptLevel() != CodeGenOpt::None)
+ addPass(createWebAssemblyStoreResults());
}
void WebAssemblyPassConfig::addPostRegAlloc() {
@@ -206,5 +208,6 @@ void WebAssemblyPassConfig::addPreEmitPa
addPass(createWebAssemblyRegNumbering());
// Perform the very last peephole optimizations on the code.
- addPass(createWebAssemblyPeephole());
+ if (getOptLevel() != CodeGenOpt::None)
+ addPass(createWebAssemblyPeephole());
}
More information about the llvm-commits
mailing list