[PATCH] D33055: [LoopOptimizer][Fix]PR32859, PR24738

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 11:13:00 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D33055#751254, @dtemirbulatov wrote:

> Well, Out of the LCSSA for we could have "phi i32 [ 0, %for.inc.2.i ]" or "phi i32 [ undef, %for.inc.2.i ]" like in PR14725, but the IR Verifier requires for PHI one entry for each predecessor of its parent basic block. The original PR14725 just added 'undef' for an predecessor BB and it is not correct. We copy the real value for another predecessor instead of bringing 'undef'.


Not all LCSSA phis are single variable phis.

Any loop exit with multiple predecessors will have multiple incoming edges.
Why is "0" the right predecessor to pick there?
ISTM the right predecessor would be the one that  we would have gone through before we split the loop.

IE if the loop is split at block B, the right predecessor is whichever would have been reached by B.


https://reviews.llvm.org/D33055





More information about the llvm-commits mailing list