summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorBetul Buyukkurt <betulb@codeaurora.org>2016-04-04 18:56:36 +0000
committerBetul Buyukkurt <betulb@codeaurora.org>2016-04-04 18:56:36 +0000
commit18131c4216960f1bf83c59a32ad7ba735a1b6d23 (patch)
tree31cfaba084c9efc5c5eb55f49cdb74cbee87409b /llvm/lib/Transforms/Instrumentation
parent870c34f0cfe0678dedcec33770fe4304b60c2e0c (diff)
downloadbcm5719-llvm-18131c4216960f1bf83c59a32ad7ba735a1b6d23.tar.gz
bcm5719-llvm-18131c4216960f1bf83c59a32ad7ba735a1b6d23.zip
[PGO] Avoid instrumenting direct callee's at value sites.
Direct callees' that are cast to other function prototypes, show up in the Call/Invoke instructions as ConstantExpr's. Currently llvm::CallSite's getCalledFunction() fails to return the callees in such expressions as direct calls. Value profiling should avoid instrumenting such cases. Mostly NFC. llvm-svn: 265330
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/IndirectCallSiteVisitor.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/IndirectCallSiteVisitor.h b/llvm/lib/Transforms/Instrumentation/IndirectCallSiteVisitor.h
index baf49c79f6d..71a8cb88632 100644
--- a/llvm/lib/Transforms/Instrumentation/IndirectCallSiteVisitor.h
+++ b/llvm/lib/Transforms/Instrumentation/IndirectCallSiteVisitor.h
@@ -28,6 +28,8 @@ struct PGOIndirectCallSiteVisitor
if (CI->isInlineAsm())
return;
}
+ if (isa<Constant>(CS.getCalledValue()))
+ return;
IndirectCallInsts.push_back(I);
}
};
OpenPOWER on IntegriCloud