Give GlobalsModRef a whirl in the nightly testers.
authorDuncan Sands <baldrick@free.fr>
Fri, 12 Sep 2008 08:23:37 +0000 (08:23 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 12 Sep 2008 08:23:37 +0000 (08:23 +0000)
I placed it just before GVN because that it is the
pass most likely to benefit from it.  Some quick
and dirty testing confirms that this is a decent
place for it.

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

tools/opt/opt.cpp

index 1d8ce576d6a894473f576e64db206478f3e3a875..eb4fbda8fac37580ee40e87093500ba6ebf0fcd1 100644 (file)
@@ -280,11 +280,13 @@ void AddStandardCompilePasses(PassManager &PM) {
   addPass(PM, createLoopUnswitchPass());         // Unswitch loops.
   addPass(PM, createLoopIndexSplitPass());       // Index split loops.
   // FIXME : Removing instcombine causes nestedloop regression.
-  addPass(PM, createInstructionCombiningPass()); 
+  addPass(PM, createInstructionCombiningPass());
   addPass(PM, createIndVarSimplifyPass());       // Canonicalize indvars
   addPass(PM, createLoopDeletionPass());         // Delete dead loops
   addPass(PM, createLoopUnrollPass());           // Unroll small loops
   addPass(PM, createInstructionCombiningPass()); // Clean up after the unroller
+  addPass(PM, createGlobalsModRefPass());        // Alias analysis of globals
+  addPass(PM, createMarkModRefPass());       // Mark functions readonly/readnone
   addPass(PM, createGVNPass());                  // Remove redundancies
   addPass(PM, createMemCpyOptPass());            // Remove memcpy / form memset
   addPass(PM, createSCCPPass());                 // Constant prop with SCCP