diff options
author | Rong Xu <xur@google.com> | 2016-04-28 17:49:56 +0000 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2016-04-28 17:49:56 +0000 |
commit | 62d5e473ce722145f76935e04ea3f613763b2f63 (patch) | |
tree | f773bb2bd11a74a49cd1c59f28cfdacd7d87ca1b /llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp | |
parent | 6a2ec9fc57d7fb889079b91071844577bca952c7 (diff) | |
download | bcm5719-llvm-62d5e473ce722145f76935e04ea3f613763b2f63.tar.gz bcm5719-llvm-62d5e473ce722145f76935e04ea3f613763b2f63.zip |
[PGO] Fix incorrect Twine usage in emitting optimization remarks.
Should not store Twine objects to local variables. This is fixed the test
failures with r267815 in VS2015 X64 build.
llvm-svn: 267908
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp b/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp index 0416efd8996..87df5121b20 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. |