diff options
author | Dehao Chen <dehao@google.com> | 2017-02-06 18:10:36 +0000 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2017-02-06 18:10:36 +0000 |
commit | c81483d79cc0878e4dc03af564635daf9ee7e888 (patch) | |
tree | 3ab7b91b90d84c803773b9d4396ce5297d830093 /llvm/lib/Transforms/IPO/SampleProfile.cpp | |
parent | 71cb164a563db8df011e24cde23dac7e0ccff099 (diff) | |
download | bcm5719-llvm-c81483d79cc0878e4dc03af564635daf9ee7e888.tar.gz bcm5719-llvm-c81483d79cc0878e4dc03af564635daf9ee7e888.zip |
Fix the bug of samplepgo indirect call promption when type casting of the return value is needed.
Summary: When type casting of the return value is needed, promoteIndirectCall will return the type casting instruction instead of the direct call. This patch changed to return the direct call instruction instead.
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D29569
llvm-svn: 294205
Diffstat (limited to 'llvm/lib/Transforms/IPO/SampleProfile.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/SampleProfile.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index 50868f42c92..87015272b96 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -643,7 +643,9 @@ bool SampleProfileLoader::inlineHotFunctions(Function &F) { // 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. - DI = promoteIndirectCall(I, CalledFunction, 80, 100); + DI = dyn_cast<Instruction>( + promoteIndirectCall(I, CalledFunction, 80, 100) + ->stripPointerCasts()); PromotedInsns.insert(I); } else { DEBUG(dbgs() << "\nFailed to promote indirect call to " |