Run SimplifyLibCalls near the beginning, not at
authorDuncan Sands <baldrick@free.fr>
Thu, 17 Apr 2008 12:03:38 +0000 (12:03 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 17 Apr 2008 12:03:38 +0000 (12:03 +0000)
the end.  It is now run at the same moment as in
llvm-gcc.  Also, run StripDeadPrototypes at the
end, just before running DeadTypeElimination.
This may be useful when doing LTO.  Note that
llvm-gcc runs StripDeadPrototypes but not
DeadTypeElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49848 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt/opt.cpp

index 80deb75b745204a7b63a8138f884a6f10ff9fef7..ca206cf37f7fada0bdf24630d6516348e844633b 100644 (file)
@@ -262,6 +262,7 @@ void AddStandardCompilePasses(PassManager &PM) {
 
   if (!DisableInline)
     addPass(PM, createFunctionInliningPass());   // Inline small functions
+  addPass(PM, createSimplifyLibCallsPass());     // Library Call Optimizations
   addPass(PM, createArgumentPromotionPass());    // Scalarize uninlined fn args
 
   addPass(PM, createTailDuplicationPass());      // Simplify cfg by copying code
@@ -294,7 +295,7 @@ void AddStandardCompilePasses(PassManager &PM) {
   addPass(PM, createDeadStoreEliminationPass()); // Delete dead stores
   addPass(PM, createAggressiveDCEPass());        // SSA based 'Aggressive DCE'
   addPass(PM, createCFGSimplificationPass());    // Merge & remove BBs
-  addPass(PM, createSimplifyLibCallsPass());     // Library Call Optimizations
+  addPass(PM, createStripDeadPrototypesPass());  // Get rid of dead prototypes
   addPass(PM, createDeadTypeEliminationPass());  // Eliminate dead types
   addPass(PM, createConstantMergePass());        // Merge dup global constants
 }