[PATCH] D132365: [DSE] Support looking through memory phis at end of function.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 29 09:08:16 PDT 2022


fhahn updated this revision to Diff 456368.
fhahn edited the summary of this revision.
fhahn added a comment.

Update to use isGuaranteedLoopInvariant instead of isGuaranteedLoopIndependent. isGuaranteedLoopIndependent is too loose here because we are not looking for must-alias (as we do for elimination candidates). Instead we must ensure we do not miss any potential reads.

In D132365#3752700 <https://reviews.llvm.org/D132365#3752700>, @aeubanks wrote:

> pardon my ignorance, but could you give an example of something where naively adding all `MemoryPhi` users misses something but using `isGuaranteedLoopIndependent` works around that?

The tests in multiblock-loop-carried-dependence.ll should provide such cases, e.g. @test.1 which was incorrectly optimized by the earlier version of the test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132365

Files:
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
  llvm/test/Transforms/DeadStoreElimination/multiblock-memintrinsics.ll
  llvm/test/Transforms/DeadStoreElimination/phi-translation.ll
  llvm/test/Transforms/MemCpyOpt/memcpy.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132365.456368.patch
Type: text/x-patch
Size: 6477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220829/18aa0dbc/attachment.bin>


More information about the llvm-commits mailing list