diff options
author | Adam Nemet <anemet@apple.com> | 2016-09-30 03:44:16 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2016-09-30 03:44:16 +0000 |
commit | f57cc62abf4d2d5fec91716372d060662d678fc8 (patch) | |
tree | 9b7486db6078d99a2776fca4f47443f9335aa3f2 /llvm/lib/Transforms/Utils/LoopUnroll.cpp | |
parent | d28694739c103eae65210c7c7c76f8ee81bf662b (diff) | |
download | bcm5719-llvm-f57cc62abf4d2d5fec91716372d060662d678fc8.tar.gz bcm5719-llvm-f57cc62abf4d2d5fec91716372d060662d678fc8.zip |
[LoopUnroll] Port to the new streaming interface for opt remarks.
llvm-svn: 282834
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnroll.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index 4913c7832f1..77b744ec881 100644 --- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp @@ -324,30 +324,33 @@ bool llvm::UnrollLoop(Loop *L, unsigned Count, unsigned TripCount, bool Force, (unsigned)GreatestCommonDivisor64(Count, TripMultiple); } + using namespace ore; // Report the unrolling decision. if (CompletelyUnroll) { DEBUG(dbgs() << "COMPLETELY UNROLLING loop %" << Header->getName() << " with trip count " << TripCount << "!\n"); - ORE->emitOptimizationRemark(DEBUG_TYPE, L, - Twine("completely unrolled loop with ") + - Twine(TripCount) + " iterations"); + ORE->emit(OptimizationRemark(DEBUG_TYPE, "FullyUnrolled", L->getStartLoc(), + L->getHeader()) + << "completely unrolled loop with " + << NV("UnrollCount", TripCount) << " iterations"); } else { - auto EmitDiag = [&](const Twine &T) { - ORE->emitOptimizationRemark( - DEBUG_TYPE, L, "unrolled loop by a factor of " + Twine(Count) + T); - }; + OptimizationRemark Diag(DEBUG_TYPE, "PartialUnrolled", L->getStartLoc(), + L->getHeader()); + Diag << "unrolled loop by a factor of " << NV("UnrollCount", Count); DEBUG(dbgs() << "UNROLLING loop %" << Header->getName() << " by " << Count); if (TripMultiple == 0 || BreakoutTrip != TripMultiple) { DEBUG(dbgs() << " with a breakout at trip " << BreakoutTrip); - EmitDiag(" with a breakout at trip " + Twine(BreakoutTrip)); + ORE->emit(Diag << " with a breakout at trip " + << NV("BreakoutTrip", BreakoutTrip)); } else if (TripMultiple != 1) { DEBUG(dbgs() << " with " << TripMultiple << " trips per branch"); - EmitDiag(" with " + Twine(TripMultiple) + " trips per branch"); + ORE->emit(Diag << " with " << NV("TripMultiple", TripMultiple) + << " trips per branch"); } else if (RuntimeTripCount) { DEBUG(dbgs() << " with run-time trip count"); - EmitDiag(" with run-time trip count"); + ORE->emit(Diag << " with run-time trip count"); } DEBUG(dbgs() << "!\n"); } |