summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2017-06-09 23:18:11 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2017-06-09 23:18:11 +0000
commit647025f9e10e59c3fc31aeb8964f3dd16e3c0516 (patch)
tree42b222cd52b29605151e2c869aac001a7005a489 /llvm/lib/Analysis/InlineCost.cpp
parentdd9627047202118037ea4347b74cfa593e2a2fe8 (diff)
downloadbcm5719-llvm-647025f9e10e59c3fc31aeb8964f3dd16e3c0516.tar.gz
bcm5719-llvm-647025f9e10e59c3fc31aeb8964f3dd16e3c0516.zip
[InstSimplify] Don't constant fold or DCE calls that are marked nobuiltin
Differential Revision: https://reviews.llvm.org/D33737 llvm-svn: 305132
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 77c87928728..6ff5938a317 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -869,7 +869,7 @@ bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) {
// because we have to continually rebuild the argument list even when no
// simplifications can be performed. Until that is fixed with remapping
// inside of instsimplify, directly constant fold calls here.
- if (!canConstantFoldCallTo(F))
+ if (!canConstantFoldCallTo(CS, F))
return false;
// Try to re-map the arguments to constants.
@@ -885,7 +885,7 @@ bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) {
ConstantArgs.push_back(C);
}
- if (Constant *C = ConstantFoldCall(F, ConstantArgs)) {
+ if (Constant *C = ConstantFoldCall(CS, F, ConstantArgs)) {
SimplifiedValues[CS.getInstruction()] = C;
return true;
}
OpenPOWER on IntegriCloud