summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2015-04-14 15:52:57 +0000
committerChad Rosier <mcrosier@codeaurora.org>2015-04-14 15:52:57 +0000
commit7a20ed762761c93f517e0a2c8a809ba57ab4831a (patch)
treee7a3ab7b9a956eb9707c280d6e3ee428747c6e5d /llvm/lib
parentfb37cfa346017a10157a702db90a4771d547cf07 (diff)
downloadbcm5719-llvm-7a20ed762761c93f517e0a2c8a809ba57ab4831a.tar.gz
bcm5719-llvm-7a20ed762761c93f517e0a2c8a809ba57ab4831a.zip
Improve RefreshCallGraph to remove invalid call graph edge.
With commit r219944, InstCombine can now turn a sqrtl into a llvm.fabs.f64. The call graph edge originally representing the call to sqrtl becomes invalid. This patch modifies CGPassManager::RefreshCallGraph() to remove the invalid call graph edge, which can triggers an assert in CallGraphNode::addCalledFunction(). Phabricator Review: http://reviews.llvm.org/D7705 Patch by Lawrence Hu <lawrence@codeaurora.org>. llvm-svn: 234902
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 9d607cc0e4f..65ba1c7c6c4 100644
--- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -212,10 +212,13 @@ bool CGPassManager::RefreshCallGraph(CallGraphSCC &CurSCC,
// list of the same call.
CallSites.count(I->first) ||
- // If the call edge is not from a call or invoke, then the function
- // pass RAUW'd a call with another value. This can happen when
- // constant folding happens of well known functions etc.
- !CallSite(I->first)) {
+ // If the call edge is not from a call or invoke, or it is a
+ // instrinsic call, then the function pass RAUW'd a call with
+ // 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())) {
assert(!CheckingMode &&
"CallGraphSCCPass did not update the CallGraph correctly!");
OpenPOWER on IntegriCloud