[WebAssembly] Disable some WebAssembly-specific optimization passes at -O0.

llvm-svn: 258127
This commit is contained in:
Dan Gohman 2016-01-19 14:55:02 +00:00
parent 3196650bf3
commit b13c91f159
1 changed files with 6 additions and 3 deletions

View File

@ -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::addPreRegAlloc() {
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::addPreEmitPass() {
addPass(createWebAssemblyRegNumbering());
// Perform the very last peephole optimizations on the code.
addPass(createWebAssemblyPeephole());
if (getOptLevel() != CodeGenOpt::None)
addPass(createWebAssemblyPeephole());
}