about summary refs log tree commit diff homepage
path: root/lib/Module
diff options
context:
space:
mode:
authorLukas Zaoral <lzaoral@redhat.com>2020-09-10 17:33:36 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-12-04 20:35:47 +0000
commitebcadf8c7a25c4580166175550bdc21c495682fe (patch)
treefe0241c69fa7d27289e39ad15910df9a69bea346 /lib/Module
parent3ba7dedcd9864a4fb91a0937ca3f570de2d12a62 (diff)
downloadklee-ebcadf8c7a25c4580166175550bdc21c495682fe.tar.gz
llvm11: IPConstantPropagationPass has been removed
See: https://reviews.llvm.org/D84447
Diffstat (limited to 'lib/Module')
-rw-r--r--lib/Module/Optimize.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Module/Optimize.cpp b/lib/Module/Optimize.cpp
index 96577ade..153c9bb8 100644
--- a/lib/Module/Optimize.cpp
+++ b/lib/Module/Optimize.cpp
@@ -108,7 +108,11 @@ static void AddStandardCompilePasses(legacy::PassManager &PM) {
   addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas
   addPass(PM, createGlobalOptimizerPass());      // Optimize out global vars
   addPass(PM, createGlobalDCEPass());            // Remove unused fns and globs
+#if LLVM_VERSION_CODE >= LLVM_VERSION(11, 0)
+  addPass(PM, createSCCPPass());                 // Constant prop with SCCP
+#else
   addPass(PM, createIPConstantPropagationPass());// IP Constant Propagation
+#endif
   addPass(PM, createDeadArgEliminationPass());   // Dead argument elimination
   addPass(PM, createInstructionCombiningPass()); // Clean up after IPCP & DAE
   addPass(PM, createCFGSimplificationPass());    // Clean up after IPCP & DAE