summaryrefslogtreecommitdiffstats
path: root/llvm/tools/gccld/GenerateCode.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-09 21:30:13 +0000
committerChris Lattner <sabre@nondot.org>2006-09-09 21:30:13 +0000
commit70b9f5bd1ed410139680d3a1a66ea4633de5495c (patch)
tree295a1df3f79f494276e528299e04b10c4c3fc8da /llvm/tools/gccld/GenerateCode.cpp
parent27ff96d87a28563b1a28766f819dedfb3e891dcf (diff)
downloadbcm5719-llvm-70b9f5bd1ed410139680d3a1a66ea4633de5495c.tar.gz
bcm5719-llvm-70b9f5bd1ed410139680d3a1a66ea4633de5495c.zip
Move ipsccp pass earlier to clean up obvious bogosities
llvm-svn: 30232
Diffstat (limited to 'llvm/tools/gccld/GenerateCode.cpp')
-rw-r--r--llvm/tools/gccld/GenerateCode.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp
index 61bcdfae717..38b3d418451 100644
--- a/llvm/tools/gccld/GenerateCode.cpp
+++ b/llvm/tools/gccld/GenerateCode.cpp
@@ -220,6 +220,11 @@ int llvm::GenerateBytecode(Module *M, int StripLevel, bool Internalize,
// internal.
addPass(Passes, createInternalizePass(Internalize));
+ // 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.
+ addPass(Passes, createIPSCCPPass());
+
// Now that we internalized some globals, see if we can hack on them!
addPass(Passes, createGlobalOptimizerPass());
@@ -227,9 +232,6 @@ int llvm::GenerateBytecode(Module *M, int StripLevel, bool Internalize,
// keep one copy of each constant...
addPass(Passes, createConstantMergePass());
- // Propagate constants at call sites into the functions they call.
- addPass(Passes, createIPSCCPPass());
-
// Remove unused arguments from functions...
addPass(Passes, createDeadArgEliminationPass());
OpenPOWER on IntegriCloud