[PATCH] D43237: [LoopInterchange] Allow some loops with PHI nodes in the exit block.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 07:36:27 PST 2018


fhahn created this revision.
fhahn added reviewers: efriedma, karthikthecool, mcrosier.

We can interchange loops with PHI nodes in the outer loop exit, if their
incoming values either

- come from outside the outer loop
- come from the inner loop, ignoring LCSSA PHI nodes.

In the latter case, the value from the inner loop will only be available
if both outer and inner loop conditions are true, which will still be true
after interchanging. So the same value will be available after
interchanging the loops.

This is a first step to support the case described in
https://bugs.llvm.org/show_bug.cgi?id=30472


https://reviews.llvm.org/D43237

Files:
  lib/Transforms/Scalar/LoopInterchange.cpp
  test/Transforms/LoopInterchange/current-limitations-lcssa.ll
  test/Transforms/LoopInterchange/lcssa.ll
  test/Transforms/LoopInterchange/reductions.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43237.134037.patch
Type: text/x-patch
Size: 16336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180213/f7438fd2/attachment.bin>


More information about the llvm-commits mailing list