[PATCH] D110234: [LoopFlatten] Updating Phi nodes after IV widening

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 05:32:20 PDT 2021


SjoerdMeijer created this revision.
SjoerdMeijer added reviewers: dmgreen, nikic, RosieSumpter.
Herald added a subscriber: hiraditya.
SjoerdMeijer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

In rG6a076fa9539e <https://reviews.llvm.org/rG6a076fa9539ee6eea078368bc5298e381c1c059e>, a problem with updating the old/narrow phi nodes after IV widening was introduced. If after widening of the IV the transformation is *not* applied, the narrow phi node was incorrectly modified, which should only happen if flattening happens. This can be seen in the added test `widen-iv2.ll`, which incorrectly had 1 incoming value, but should have its original 2 incoming values, which is now restored.


https://reviews.llvm.org/D110234

Files:
  llvm/lib/Transforms/Scalar/LoopFlatten.cpp
  llvm/test/Transforms/LoopFlatten/widen-iv2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110234.374190.patch
Type: text/x-patch
Size: 4546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210922/4c518184/attachment.bin>


More information about the llvm-commits mailing list