Skip to content

Commit e378ad8

Browse files
committed
[copy-forwarding] Move a DEBUG log of an instruction to before we destroy the instruction...
Found while debugging dc8b1c2.
1 parent c1e77bf commit e378ad8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SILOptimizer/Transforms/CopyForwarding.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,6 @@ propagateCopy(CopyAddrInst *CopyInst, bool hoistingDestroy) {
535535
assert(CopyInst->isTakeOfSrc() || hoistingDestroy);
536536
if (auto *srcCopy = findCopyIntoDeadTemp(CopyInst)) {
537537
if (forwardDeadTempCopy(srcCopy, CopyInst)) {
538-
DEBUG(llvm::dbgs() << " Temp Copy:" << *srcCopy
539-
<< " to " << *CopyInst);
540538
HasChanged = true;
541539
++NumDeadTemp;
542540
return true;
@@ -648,6 +646,9 @@ CopyAddrInst *CopyForwarding::findCopyIntoDeadTemp(CopyAddrInst *destCopy) {
648646
/// attempts to destroy this uninitialized value.
649647
bool CopyForwarding::
650648
forwardDeadTempCopy(CopyAddrInst *srcCopy, CopyAddrInst *destCopy) {
649+
DEBUG(llvm::dbgs() << " Temp Copy:" << *srcCopy
650+
<< " to " << *destCopy);
651+
651652
assert(srcCopy->getDest() == destCopy->getSrc());
652653

653654
// This pattern can be trivially folded without affecting %temp destroys:

0 commit comments

Comments
 (0)