Skip to content

Commit 94e6ed6

Browse files
committed
[MemCpyOpt] Stop using callCapturesBefore()
After llvm#110280 we use EarliestEscapeInfo, so callCapturesBefore() is mostly redundant. It can provide better results in some cases because EEI does an approximation across all captures. I hope that it's good enough in practice, as this is the last remaining user of callCapturesBefore(), so we'll be able to remove this API entirely.
1 parent 79382eb commit 94e6ed6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,11 +1054,7 @@ bool MemCpyOptPass::performCallSlotOptzn(Instruction *cpyLoad,
10541054
// the use analysis, we also need to know that it does not sneakily
10551055
// access dest. We rely on AA to figure this out for us.
10561056
MemoryLocation DestWithSrcSize(cpyDest, LocationSize::precise(srcSize));
1057-
ModRefInfo MR = BAA.getModRefInfo(C, DestWithSrcSize);
1058-
// If necessary, perform additional analysis.
1059-
if (isModOrRefSet(MR))
1060-
MR = BAA.callCapturesBefore(C, DestWithSrcSize, DT);
1061-
if (isModOrRefSet(MR))
1057+
if (isModOrRefSet(BAA.getModRefInfo(C, DestWithSrcSize)))
10621058
return false;
10631059

10641060
// We can't create address space casts here because we don't know if they're

0 commit comments

Comments
 (0)