[llvm] r225063 - [SROA] Switch to using a more direct debug logging technique in one part
Chandler Carruth
chandlerc at gmail.com
Thu Jan 1 04:56:48 PST 2015
Author: chandlerc
Date: Thu Jan 1 06:56:47 2015
New Revision: 225063
URL: http://llvm.org/viewvc/llvm-project?rev=225063&view=rev
Log:
[SROA] Switch to using a more direct debug logging technique in one part
of my new load and store splitting, and fix a bug where it logged
a totally irrelevant slice rather than the actual slice in question.
The logging here previously worked because we used to place new slices
onto the back of the core sequence, but that caused other problems.
I updated the actual code to store new slices in their own vector but
didn't update the logging. There isn't a good way to reuse the logging
any more, and frankly it wasn't needed. We can directly log this bit
more easily.
Modified:
llvm/trunk/lib/Transforms/Scalar/SROA.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=225063&r1=225062&r2=225063&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Thu Jan 1 06:56:47 2015
@@ -3702,8 +3702,9 @@ bool SROA::presplitLoadsAndStores(Alloca
Slice(BaseOffset + PartOffset, BaseOffset + PartOffset + PartSize,
&PLoad->getOperandUse(PLoad->getPointerOperandIndex()),
/*IsSplittable*/ true));
- DEBUG(AS.printSlice(dbgs(), std::prev(AS.end()), " "));
- DEBUG(dbgs() << ": " << *PLoad << "\n");
+ DEBUG(dbgs() << " new slice [" << NewSlices.back().beginOffset()
+ << ", " << NewSlices.back().endOffset() << "): " << *PLoad
+ << "\n");
// Setup the next partition.
PartOffset = Offsets.Splits[Idx];
@@ -3837,8 +3838,9 @@ bool SROA::presplitLoadsAndStores(Alloca
Slice(BaseOffset + PartOffset, BaseOffset + PartOffset + PartSize,
&PStore->getOperandUse(PStore->getPointerOperandIndex()),
/*IsSplittable*/ true));
- DEBUG(AS.printSlice(dbgs(), std::prev(AS.end()), " "));
- DEBUG(dbgs() << ": " << *PStore << "\n");
+ DEBUG(dbgs() << " new slice [" << NewSlices.back().beginOffset()
+ << ", " << NewSlices.back().endOffset() << "): " << *PStore
+ << "\n");
if (!SplitLoads) {
DEBUG(dbgs() << " of split load: " << *PLoad << "\n");
}
More information about the llvm-commits
mailing list