diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-06-18 19:28:26 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2015-06-18 19:28:26 +0000 |
commit | c65d43e64926c9f868213f453bb4cdc3d4ab7879 (patch) | |
tree | 2620519c537d573b07605b61b396df72d46e3752 /llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | |
parent | 5c38440b2b6866bf622ed5e81840587873455f96 (diff) | |
download | bcm5719-llvm-c65d43e64926c9f868213f453bb4cdc3d4ab7879.tar.gz bcm5719-llvm-c65d43e64926c9f868213f453bb4cdc3d4ab7879.zip |
[CallGraph] Teach the CallGraph about non-leaf intrinsics.
Summary:
Currently intrinsics don't affect the creation of the call graph.
This is not accurate with respect to statepoint and patchpoint
intrinsics -- these do call (or invoke) LLVM level functions.
This change fixes this inconsistency by adding a call to the external
node for call sites that call these non-leaf intrinsics. This coupled
with the fact that these intrinsics also escape the function pointer
they call gives us a conservatively correct call graph.
Reviewers: reames, chandlerc, atrick, pgavlin
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10526
llvm-svn: 240039
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index 65ba1c7c6c4..6b3e0634626 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp @@ -217,8 +217,10 @@ bool CGPassManager::RefreshCallGraph(CallGraphSCC &CurSCC, // another value. This can happen when constant folding happens // of well known functions etc. !CallSite(I->first) || - (CallSite(I->first).getCalledFunction() && - CallSite(I->first).getCalledFunction()->isIntrinsic())) { + (CallSite(I->first).getCalledFunction() && + CallSite(I->first).getCalledFunction()->isIntrinsic() && + Intrinsic::isLeaf( + CallSite(I->first).getCalledFunction()->getIntrinsicID()))) { assert(!CheckingMode && "CallGraphSCCPass did not update the CallGraph correctly!"); |