Use IPSCCPPass instead of IPConstantPropagationPass.
authorDevang Patel <dpatel@apple.com>
Tue, 27 May 2008 20:18:45 +0000 (20:18 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 27 May 2008 20:18:45 +0000 (20:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51605 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lto2/LTOCodeGenerator.cpp

index e829cfb6dc35854589248e1842e2f03492a72e02..ae97694a9204736f54479ff51644376d950ec421 100644 (file)
@@ -340,6 +340,11 @@ bool LTOCodeGenerator::generateAssemblyCode(std::ostream& out, std::string& errM
     // Add an appropriate TargetData instance for this module...
     passes.add(new TargetData(*_target->getTargetData()));
     
+    // Propagate constants at call sites into the functions they call.  This
+    // opens opportunities for globalopt (and inlining) by substituting function
+    // pointers passed as arguments to direct uses of functions.  
+    passes.add(createIPSCCPPass());
+
     // Now that we internalized some globals, see if we can hack on them!
     passes.add(createGlobalOptimizerPass());
 
@@ -352,9 +357,6 @@ bool LTOCodeGenerator::generateAssemblyCode(std::ostream& out, std::string& errM
     // supporting.
     passes.add(createStripSymbolsPass());
     
-    // Propagate constants at call sites into the functions they call.
-    passes.add(createIPConstantPropagationPass());
-
     // Remove unused arguments from functions...
     passes.add(createDeadArgEliminationPass());