[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)
commitaabacb67c3dab68c75d9eef390d6eb08aa62c8ac
tree781b0060ea741e30df84f07e1f125b0f28ca24a3
parent6d136d7300c60f31d0a01fee2e524c004c9f4c42
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240039 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/CallGraph.h
include/llvm/IR/Intrinsics.h
lib/Analysis/IPA/CallGraph.cpp
lib/Analysis/IPA/CallGraphSCCPass.cpp
lib/IR/Function.cpp
test/Analysis/CallGraph/non-leaf-intrinsics.ll [new file with mode: 0644]