[PATCH] D39097: [LoopPredication] Handle the case when the guard and the latch IV have different offsets

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 07:17:38 PDT 2017


anna requested changes to this revision.
anna added a comment.
This revision now requires changes to proceed.

Artur, before this patch, we were checking whether RangeCheckIV's postIncExpr is latchCheckIV.

Now, the header comments and proof seems to point to the fact that the guard and latch are using the same offset (lines 103 - 110), but the code does not have any check that we are using the same offset. Or, is it that the offset is the same, but the difference in the latchCheckIV versus rangeCheckIV is caught in their respective `start` values, and the offset for both latch and guard remains the same?

Pls see inline comment for more clarification and specific example.



================
Comment at: lib/Transforms/Scalar/LoopPredication.cpp:61
 //       guard(G(I));
-//     } while (B(I.INC));
+//     } while (B(I));
 //   }
----------------
Now that arbitrary offsets are supported for both guard and latch, the guard can even be `guard(G(I.INC))`, while the backedge condition can be `B(I)`?
In other words, do we need the same offset 'i' for both guard and latch?

Please add a testcase when the guard uses the I.INC and backedge uses I.



https://reviews.llvm.org/D39097





More information about the llvm-commits mailing list