Skip to content

Commit 677c2c2

Browse files
committed
Add the function attributes pass during LTO time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65508 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d838fcd commit 677c2c2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/llvm-ld/Optimize.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ void Optimize(Module* M) {
136136
addPass(Passes, createScalarReplAggregatesPass()); // Break up allocas
137137

138138
// Run a few AA driven optimizations here and now, to cleanup the code.
139+
addPass(Passes, createFunctionAttrsPass()); // Add nocapture
139140
addPass(Passes, createGlobalsModRefPass()); // IP alias analysis
140141

141142
addPass(Passes, createLICMPass()); // Hoist loop invariants
142-
addPass(Passes, createGVNPass()); // Remove redundancies
143+
addPass(Passes, createGVNPass()); // Remove redundancies
143144
addPass(Passes, createMemCpyOptPass()); // Remove dead memcpy's
144145
addPass(Passes, createDeadStoreEliminationPass()); // Nuke dead stores
145146

tools/lto/LTOCodeGenerator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ bool LTOCodeGenerator::generateAssemblyCode(raw_ostream& out,
391391
passes.add(createScalarReplAggregatesPass()); // Break up allocas
392392

393393
// Run a few AA driven optimizations here and now, to cleanup the code.
394+
passes.add(createFunctionAttrsPass()); // Add nocapture
394395
passes.add(createGlobalsModRefPass()); // IP alias analysis
395396
passes.add(createLICMPass()); // Hoist loop invariants
396397
passes.add(createGVNPass()); // Remove common subexprs

0 commit comments

Comments
 (0)