diff options
Diffstat (limited to 'lib/Module/Optimize.cpp')
-rw-r--r-- | lib/Module/Optimize.cpp | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp index 0980c060..44708b11 100644 --- a/lib/Module/Optimize.cpp +++ b/lib/Module/Optimize.cpp @@ -22,11 +22,13 @@ #include "Passes.h" #endif +#include "llvm/Analysis/GlobalsModRef.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/LoopPass.h" #include "llvm/IR/Module.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/LegacyPassManager.h" +#include "llvm/IR/Verifier.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/DynamicLibrary.h" #include "llvm/Support/PluginLoader.h" @@ -34,16 +36,6 @@ #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) -#include "llvm/IR/Verifier.h" -#else -#include "llvm/Analysis/Verifier.h" -#endif - -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) -#include "llvm/Analysis/GlobalsModRef.h" -#endif - #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) #include "llvm/Transforms/IPO/FunctionAttrs.h" #include "llvm/Transforms/Scalar/GVN.h" @@ -122,16 +114,12 @@ static void AddStandardCompilePasses(legacy::PassManager &PM) { addPass(PM, createCFGSimplificationPass()); // Clean up after IPCP & DAE addPass(PM, createPruneEHPass()); // Remove dead EH info -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) addPass(PM, createPostOrderFunctionAttrsLegacyPass()); #else addPass(PM, createPostOrderFunctionAttrsPass()); #endif addPass(PM, createReversePostOrderFunctionAttrsPass()); // Deduce function attrs -#else - addPass(PM, createFunctionAttrsPass()); // Deduce function attrs -#endif if (!DisableInline) addPass(PM, createFunctionInliningPass()); // Inline small functions @@ -190,19 +178,6 @@ void Optimize(Module *M, llvm::ArrayRef<const char *> preservedFunctions) { addPass(Passes, new klee::WorkaroundLLVMPR39177Pass()); #endif - // Add an appropriate DataLayout instance for this module... -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 7) - // LLVM 3.7+ doesn't have DataLayoutPass anymore. -#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 6) - DataLayoutPass *dlpass = new DataLayoutPass(); - dlpass->doInitialization(*M); - addPass(Passes, dlpass); -#elif LLVM_VERSION_CODE >= LLVM_VERSION(3, 5) - addPass(Passes, new DataLayoutPass(M)); -#else - addPass(Passes, new DataLayout(M)); -#endif - // DWD - Run the opt standard pass list as well. AddStandardCompilePasses(Passes); @@ -269,7 +244,6 @@ void Optimize(Module *M, llvm::ArrayRef<const char *> preservedFunctions) { #endif // Run a few AA driven optimizations here and now, to cleanup the code. -#if LLVM_VERSION_CODE >= LLVM_VERSION(3, 8) #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 9) addPass(Passes, createPostOrderFunctionAttrsLegacyPass()); #else @@ -277,10 +251,6 @@ void Optimize(Module *M, llvm::ArrayRef<const char *> preservedFunctions) { #endif addPass(Passes, createReversePostOrderFunctionAttrsPass()); // Add nocapture addPass(Passes, createGlobalsAAWrapperPass()); // IP alias analysis -#else - addPass(Passes, createFunctionAttrsPass()); // Add nocapture - addPass(Passes, createGlobalsModRefPass()); // IP alias analysis -#endif addPass(Passes, createLICMPass()); // Hoist loop invariants addPass(Passes, createGVNPass()); // Remove redundancies |