[CallGraph] Teach the CallGraph about non-leaf intrinsics.
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 18 Jun 2015 19:28:26 +0000 (19:28 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 18 Jun 2015 19:28:26 +0000 (19:28 +0000)
commitc65d43e64926c9f868213f453bb4cdc3d4ab7879
tree2620519c537d573b07605b61b396df72d46e3752
parent5c38440b2b6866bf622ed5e81840587873455f96
[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
llvm/include/llvm/Analysis/CallGraph.h
llvm/include/llvm/IR/Intrinsics.h
llvm/lib/Analysis/IPA/CallGraph.cpp
llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
llvm/lib/IR/Function.cpp
llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll [new file with mode: 0644]