summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2017-10-06 17:04:55 +0000
committerDehao Chen <dehao@google.com>2017-10-06 17:04:55 +0000
commit01343e961e79d0396042335dcda5938af5311e6a (patch)
tree67c6d0040916d761036cf5cc7afcd60dfc23f9bf /lib/Transforms/IPO
parent5124768496a6c000c56b7c4fe69f2926eddf9518 (diff)
Directly return promoted direct call instead of rely on stripPointerCast.
Summary: stripPointerCast is not reliably returning the value that's being type-casted. Instead it may look further at function attributes to further propagate the value. Instead of relying on stripPOintercast, the more reliable solution is to directly use the pointer to the promoted direct call. Reviewers: tejohnson, davidxl Reviewed By: tejohnson Subscribers: llvm-commits, sanjoy Differential Revision: https://reviews.llvm.org/D38603 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/SampleProfile.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/SampleProfile.cpp b/lib/Transforms/IPO/SampleProfile.cpp
index fb7397c3d8e..39e3696972d 100644
--- a/lib/Transforms/IPO/SampleProfile.cpp
+++ b/lib/Transforms/IPO/SampleProfile.cpp
@@ -790,9 +790,8 @@ bool SampleProfileLoader::inlineHotFunctions(
// as a result, we do not have profile info for the branch
// probability. We set the probability to 80% taken to indicate
// that the static call is likely taken.
- Instruction *DI = dyn_cast<Instruction>(
- promoteIndirectCall(I, R->getValue(), 80, 100, false, ORE)
- ->stripPointerCasts());
+ Instruction *DI = promoteIndirectCall(
+ I, R->getValue(), 80, 100, false, ORE);
PromotedInsns.insert(I);
// If profile mismatches, we should not attempt to inline DI.
if ((isa<CallInst>(DI) || isa<InvokeInst>(DI)) &&