Skip to content

Commit 2014ba5

Browse files
committed
avoid some redundant work
1 parent d3825e4 commit 2014ba5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5534,13 +5534,16 @@ bool SROA::propagateStoredValuesToLoads(AllocaInst &AI, AllocaSlices &AS) {
55345534
BeginOffset = S.beginOffset();
55355535
EndOffset = S.endOffset();
55365536
} else if (S.beginOffset() != BeginOffset || S.endOffset() != EndOffset) {
5537-
LLVM_DEBUG({
5538-
dbgs() << "Slice does not match range [" << BeginOffset << ", "
5539-
<< EndOffset << ")";
5540-
AS.print(dbgs(), &S);
5541-
});
5542-
AllSameAndValid = false;
5537+
if (AllSameAndValid) {
5538+
LLVM_DEBUG({
5539+
dbgs() << "Slice does not match range [" << BeginOffset << ", "
5540+
<< EndOffset << ")";
5541+
AS.print(dbgs(), &S);
5542+
});
5543+
AllSameAndValid = false;
5544+
}
55435545
EndOffset = std::max(EndOffset, S.endOffset());
5546+
continue;
55445547
}
55455548

55465549
if (auto *LI = dyn_cast<LoadInst>(User)) {

0 commit comments

Comments
 (0)