Skip to content

Commit d1a1cce

Browse files
committed
[DSE,MemorySSA] Do not use callCapturesBefore in isReadClobber.
Using callCapturesBefore potentially improves the precision and the number of stores we can remove. But in practice, it seems to have very little impact in terms of stores removed. For example, for SPEC2000/SPEC2006/MultiSource with -O3 -flto, ~50 more stores are removed (out of ~26900 stores removed). But in terms of compile-time, it is very expensive and the patch gives substantial compile-time improvements: Geomean O3 -0.24%, ReleaseThinLTO -0.47%, ReleaseLTO-g -0.39%. http://llvm-compile-time-tracker.com/compare.php?from=612a0bff88ed906c83b82f079d4c49e5fecfb9d0&to=e6c86b96d20d97dd88e903a409bd8d39b6114312&stat=instructions
1 parent c9b45ce commit d1a1cce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,11 +1762,11 @@ struct DSEState {
17621762
if (CB->onlyAccessesInaccessibleMemory())
17631763
return false;
17641764

1765-
ModRefInfo MR = BatchAA.getModRefInfo(UseInst, DefLoc);
1766-
// If necessary, perform additional analysis.
1767-
if (isRefSet(MR))
1768-
MR = AA.callCapturesBefore(UseInst, DefLoc, &DT);
1769-
return isRefSet(MR);
1765+
// NOTE: For calls, the number of stores removed could be slightly improved
1766+
// by using AA.callCapturesBefore(UseInst, DefLoc, &DT), but that showed to
1767+
// be expensive compared to the benefits in practice. For now, avoid more
1768+
// expensive analysis to limit compile-time.
1769+
return isRefSet(BatchAA.getModRefInfo(UseInst, DefLoc));
17701770
}
17711771

17721772
// Find a MemoryDef writing to \p DefLoc and dominating \p Current, with no

0 commit comments

Comments
 (0)