[PATCH] D68144: [LoopInterchange] Improve inner exit loop safety checks.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 09:29:05 PDT 2019


fhahn created this revision.
fhahn added reviewers: efriedma, mcrosier.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

The PHI node checks for inner loop exits are too permissive currently.
As indicated by an existing comment, we should only allow LCSSA PHI
nodes that are part of reductions or are only used outside of the loop
nest. We ensure this by checking the users of the LCSSA PHIs.
Specifically, it is not safe to use the LCSSA in the latch of the outer
loop.

It also moves the inner loop exit check before the outer loop exit
check.

Fixes PR43473.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68144

Files:
  llvm/lib/Transforms/Scalar/LoopInterchange.cpp
  llvm/test/Transforms/LoopInterchange/pr43473-invalid-lcssa-phis-in-inner-exit.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68144.222189.patch
Type: text/x-patch
Size: 9696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190927/a5e69c1a/attachment.bin>


More information about the llvm-commits mailing list