[PATCH] D46198: [LoopInterchange] Move PHI handling to adjustLoopBranches.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 27 10:27:14 PDT 2018


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

This patch moves the logic to handle reduction PHI nodes to the end of
adjustLoopBranches. Reduction PHI nodes in the outer loop header can be
moved to the inner loop header and reduction PHI nodes from the inner loop
header can be moved to the outer loop header. In the latter situation,
we have to deal with 2 kinds of PHI nodes:

  PHI nodes that are part of a reduction in the outer loop
  PHI nodes that are part of inner loop-only reductions.

For 1) we only have to move the PHI node and update the incoming blocks.
For 2) we can replace the PHI node with the value coming from outside
the inner loop.


https://reviews.llvm.org/D46198

Files:
  lib/Transforms/Scalar/LoopInterchange.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46198.144367.patch
Type: text/x-patch
Size: 4200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180427/cccf8749/attachment.bin>


More information about the llvm-commits mailing list