diff options
Diffstat (limited to 'lib/Module/Optimize.cpp')
-rw-r--r-- | lib/Module/Optimize.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index 83e67292..affe9392 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -94,7 +94,9 @@ static void AddStandardCompilePasses(PassManager &PM) { if (DisableOptimizations) return; +#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) addPass(PM, createRaiseAllocationsPass()); // call %malloc -> malloc inst +#endif addPass(PM, createCFGSimplificationPass()); // Clean up disgusting code addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas addPass(PM, createGlobalOptimizerPass()); // Optimize out global vars @@ -117,7 +119,9 @@ static void AddStandardCompilePasses(PassManager &PM) { addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas addPass(PM, createInstructionCombiningPass()); // Combine silly seq's +#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) addPass(PM, createCondPropagationPass()); // Propagate conditionals +#endif addPass(PM, createTailCallEliminationPass()); // Eliminate tail calls addPass(PM, createCFGSimplificationPass()); // Merge & remove BBs @@ -139,7 +143,9 @@ static void AddStandardCompilePasses(PassManager &PM) { // Run instcombine after redundancy elimination to exploit opportunities // opened up by them. addPass(PM, createInstructionCombiningPass()); +#if (LLVM_VERSION_MAJOR == 2 && LLVM_VERSION_MINOR < 7) addPass(PM, createCondPropagationPass()); // Propagate conditionals +#endif addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores addPass(PM, createAggressiveDCEPass()); // Delete dead instructions |