diff options
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 " |