diff --git a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp index 0416efd8996a667a8561c51cccf07f54aad3e492..87df5121b20a79bd1e15aadf709a533dacc7e210 100644 --- a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp +++ b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp @@ -327,12 +327,11 @@ ICallPromotionFunc::getPromotionCandidatesForCallSite( StringRef TargetFuncName = Symtab->getFuncName(Target); const char *Reason = StatusToString(Status); DEBUG(dbgs() << " Not promote: " << Reason << "\n"); - Twine Msg = + emitOptimizationRemarkMissed( + F.getContext(), "PGOIndirectCallPromotion", F, Inst->getDebugLoc(), Twine("Cannot promote indirect call to ") + - (TargetFuncName.empty() ? Twine(Target) : Twine(TargetFuncName)) + - Twine(" with count of ") + Twine(Count) + ": " + Reason; - emitOptimizationRemarkMissed(F.getContext(), "PGOIndirectCallPromotion", - F, Inst->getDebugLoc(), Msg); + (TargetFuncName.empty() ? Twine(Target) : Twine(TargetFuncName)) + + Twine(" with count of ") + Twine(Count) + ": " + Reason); break; } Ret.push_back(PromotionCandidate(TargetFunction, Count)); @@ -603,10 +602,10 @@ void ICallPromotionFunc::promote(Instruction *Inst, Function *DirectCallee, DEBUG(dbgs() << "\n== Basic Blocks After ==\n"); DEBUG(dbgs() << *BB << *DirectCallBB << *IndirectCallBB << *MergeBB << "\n"); - Twine Msg = Twine("Promote indirect call to ") + DirectCallee->getName() + - " with count " + Twine(Count) + " out of " + Twine(TotalCount); - emitOptimizationRemark(F.getContext(), "PGOIndirectCallPromotion", F, - Inst->getDebugLoc(), Msg); + emitOptimizationRemark( + F.getContext(), "PGOIndirectCallPromotion", F, Inst->getDebugLoc(), + Twine("Promote indirect call to ") + DirectCallee->getName() + + " with count " + Twine(Count) + " out of " + Twine(TotalCount)); } // Promote indirect-call to conditional direct-call for one callsite.