Add the function attributes pass during LTO time.
authorNick Lewycky <nicholas@mxc.ca>
Thu, 26 Feb 2009 06:56:16 +0000 (06:56 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Thu, 26 Feb 2009 06:56:16 +0000 (06:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65508 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-ld/Optimize.cpp
tools/lto/LTOCodeGenerator.cpp

index af959397760f4b9ef5f4e8db3638e4f00189bdb7..f788f060d15750287a191673255449e7f68b5e38 100644 (file)
@@ -136,10 +136,11 @@ void Optimize(Module* M) {
     addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas
 
     // Run a few AA driven optimizations here and now, to cleanup the code.
+    addPass(Passes, createFunctionAttrsPass());      // Add nocapture
     addPass(Passes, createGlobalsModRefPass());      // IP alias analysis
 
     addPass(Passes, createLICMPass());               // Hoist loop invariants
-    addPass(Passes, createGVNPass());                  // Remove redundancies
+    addPass(Passes, createGVNPass());                // Remove redundancies
     addPass(Passes, createMemCpyOptPass());          // Remove dead memcpy's
     addPass(Passes, createDeadStoreEliminationPass()); // Nuke dead stores
 
index ec3f681a49d715d1821a10a59a82b146a284faff..b83b07941c8a3bc4105f95e369ac0a41e6ed982b 100644 (file)
@@ -391,6 +391,7 @@ bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
     passes.add(createScalarReplAggregatesPass()); // Break up allocas
 
     // Run a few AA driven optimizations here and now, to cleanup the code.
+    passes.add(createFunctionAttrsPass());        // Add nocapture
     passes.add(createGlobalsModRefPass());        // IP alias analysis
     passes.add(createLICMPass());                 // Hoist loop invariants
     passes.add(createGVNPass());                  // Remove common subexprs