[llvm-branch-commits] [llvm] 2b70c04 - Tweak ADCE postition

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 8 05:56:01 PDT 2020


Author: Florian Hahn
Date: 2020-09-08T13:54:45+01:00
New Revision: 2b70c04f10eb76ba6ea800234453a3e43adc0a68

URL: https://github.com/llvm/llvm-project/commit/2b70c04f10eb76ba6ea800234453a3e43adc0a68
DIFF: https://github.com/llvm/llvm-project/commit/2b70c04f10eb76ba6ea800234453a3e43adc0a68.diff

LOG: Tweak ADCE postition

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index caa9a98ecb07..9909f7437147 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -463,6 +463,11 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
   if (OptLevel > 1) {
     MPM.add(createJumpThreadingPass());         // Thread jumps
     MPM.add(createCorrelatedValuePropagationPass());
+  }
+  MPM.add(createAggressiveDCEPass());         // Delete dead instructions
+  
+  // TODO: Investigate if this is too expensive at O1.
+  if (OptLevel > 1) {
     MPM.add(createDeadStoreEliminationPass());  // Delete dead stores
     MPM.add(createLICMPass(LicmMssaOptCap, LicmMssaNoAccForPromotionCap));
   }
@@ -472,8 +477,6 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
   if (RerollLoops)
     MPM.add(createLoopRerollPass());
 
-  // TODO: Investigate if this is too expensive at O1.
-  MPM.add(createAggressiveDCEPass());         // Delete dead instructions
   MPM.add(createCFGSimplificationPass()); // Merge & remove BBs
   // Clean up after everything.
   MPM.add(createInstructionCombiningPass());


        


More information about the llvm-branch-commits mailing list