Skip to content

Commit ac7c482

Browse files
committed
[MemCpyOpt] Add extra debug output (NFC)
1 parent 6658e1a commit ac7c482

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -983,19 +983,19 @@ bool MemCpyOptPass::performCallSlotOptzn(Instruction *cpyLoad,
983983
append_range(srcUseList, U->users());
984984
continue;
985985
}
986-
if (const auto *G = dyn_cast<GetElementPtrInst>(U)) {
987-
if (!G->hasAllZeroIndices())
988-
return false;
989-
986+
if (const auto *G = dyn_cast<GetElementPtrInst>(U);
987+
G && G->hasAllZeroIndices()) {
990988
append_range(srcUseList, U->users());
991989
continue;
992990
}
993991
if (const auto *IT = dyn_cast<IntrinsicInst>(U))
994992
if (IT->isLifetimeStartOrEnd())
995993
continue;
996994

997-
if (U != C && U != cpyLoad)
995+
if (U != C && U != cpyLoad) {
996+
LLVM_DEBUG(dbgs() << "Call slot: Source accessed by " << *U << "\n");
998997
return false;
998+
}
999999
}
10001000

10011001
// Check whether src is captured by the called function, in which case there

0 commit comments

Comments
 (0)