[llvm-commits] [llvm] r64443 - in /llvm/trunk: lib/Analysis/IPA/CallGraphSCCPass.cpp test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll
Nick Lewycky
nicholas at mxc.ca
Thu Feb 12 23:15:53 PST 2009
Author: nicholas
Date: Fri Feb 13 01:15:53 2009
New Revision: 64443
URL: http://llvm.org/viewvc/llvm-project?rev=64443&view=rev
Log:
Reapply r64300:
Make sure the SCC pass manager initializes any contained
function pass managers. Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.
Modified:
llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp
llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll
Modified: llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp?rev=64443&r1=64442&r2=64443&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/CallGraphSCCPass.cpp Fri Feb 13 01:15:53 2009
@@ -135,8 +135,13 @@
bool Changed = false;
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
- if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P))
+ if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P)) {
Changed |= CGSP->doInitialization(CG);
+ } else {
+ FPPassManager *FP = dynamic_cast<FPPassManager *>(P);
+ assert (FP && "Invalid CGPassManager member");
+ Changed |= FP->doInitialization(CG.getModule());
+ }
}
return Changed;
}
@@ -146,8 +151,13 @@
bool Changed = false;
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
Pass *P = getContainedPass(Index);
- if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P))
+ if (CallGraphSCCPass *CGSP = dynamic_cast<CallGraphSCCPass *>(P)) {
Changed |= CGSP->doFinalization(CG);
+ } else {
+ FPPassManager *FP = dynamic_cast<FPPassManager *>(P);
+ assert (FP && "Invalid CGPassManager member");
+ Changed |= FP->doFinalization(CG.getModule());
+ }
}
return Changed;
}
Modified: llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll?rev=64443&r1=64442&r2=64443&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll (original)
+++ llvm/trunk/test/Transforms/SimplifyLibCalls/2009-02-11-NotInitialized.ll Fri Feb 13 01:15:53 2009
@@ -1,7 +1,7 @@
-; RUN: llvm-as < %s | opt -std-compile-opts | llvm-dis | grep nocapture | count 2
+; RUN: llvm-as < %s | opt -inline -simplify-libcalls -functionattrs | \
+; RUN: llvm-dis | grep nocapture | count 2
; Check that nocapture attributes are added when run after an SCC pass.
; PR3520
-; XFAIL: *
define i32 @use(i8* %x) nounwind readonly {
entry:
More information about the llvm-commits
mailing list