[PATCH] D100464: [DSE] Remove stores in the same loop iteration

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 16 05:11:07 PDT 2021


dmgreen updated this revision to Diff 352395.
dmgreen added a comment.
Herald added a subscriber: ormris.

Reopening with adjusted code (and more test cases). The issues were related to the checks for all paths leading to the exit collectively postdominating the earlier dead store. But:

- A store that walked back to itself was ignored, effectively killing itself. This was this issue that came up from the reproducer. It is only true if the access is loop invariant, so it now uses an extra isGuaranteedLoopInvariant() check.
- Stores in blocks with later PO numbers were again effectively ignored. With loops they need to be handled, in this case by returning None.

The number of stores remove in the llvm test suite was almost the same as with the previous version of this patch. The total remaining stores was 3 more than the last set of numbers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100464/new/

https://reviews.llvm.org/D100464

Files:
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
  llvm/test/CodeGen/AMDGPU/opt-pipeline.ll
  llvm/test/Other/opt-O2-pipeline.ll
  llvm/test/Other/opt-O3-pipeline-enable-matrix.ll
  llvm/test/Other/opt-O3-pipeline.ll
  llvm/test/Other/opt-Os-pipeline.ll
  llvm/test/Transforms/DeadStoreElimination/multiblock-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100464.352395.patch
Type: text/x-patch
Size: 15569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210616/a081ca45/attachment.bin>


More information about the llvm-commits mailing list