[PATCH] D86487: [DSE,MemorySSA] Check if DomAccess is valid for elimination first.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 14:20:34 PDT 2020


fhahn created this revision.
fhahn added reviewers: dmgreen, efriedma, bryant, asbirlea, george.burgess.iv.
Herald added subscribers: dexonsmith, hiraditya, Prazek.
Herald added a project: LLVM.
fhahn requested review of this revision.

This changes getDomMemoryDef to check if a DomAccess is a valid
candidate for elimination before checking for reads. Before the change,
we were spending a lot of compile-time in checking for read accesses for
DomAccess that might not even be removable.

This patch flips the logic, so we skip DomAccesses if they cannot be
removed before checking all their uses. This is much more efficient in
practice.

It also adds a more aggressive limit for checking partially overlapping
stores. The main problem with overlapping stores is that we do not know
if they will lead to elimination until seeing all of them. This patch
limits adds a new limit for overlapping store candidates, which keeps
the number of modified overlapping stores roughly the same.

This is another substantial compile-time improvement (while also
increasing the number of stores eliminated). Geomean -O3 -0.67%,
ReleaseThinLTO -0.97%.

http://llvm-compile-time-tracker.com/compare.php?from=0a929b6978a068af8ddb02d0d4714a2843dd8ba9&to=2e630629b43f64b60b282e90f0d96082fde2dacc&stat=instructions


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86487

Files:
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
  llvm/test/Transforms/DeadStoreElimination/MSSA/combined-partial-overwrites.ll
  llvm/test/Transforms/DeadStoreElimination/MSSA/debug-counter.ll
  llvm/test/Transforms/DeadStoreElimination/MSSA/memoryssa-scan-limit.ll
  llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-overlap.ll
  llvm/test/Transforms/DeadStoreElimination/MSSA/simple.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86487.287496.patch
Type: text/x-patch
Size: 12966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/05a87ad7/attachment.bin>


More information about the llvm-commits mailing list