[PATCH] D114916: [LoopInterchange] Enable loop interchange with multiple outer loop indvars

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 5 14:59:37 PST 2022


bmahjour added inline comments.


================
Comment at: llvm/test/Transforms/LoopInterchange/interchangeable-outerloop-multiple-indvars.ll:13
+; void fn1() {
+;  for (; c && e; c++,e++) {
+;    d = 5;
----------------
congzhe wrote:
> bmahjour wrote:
> > can these tests be changed to something more canonical (eg not relying on zero initialization of globals, and signed integer wrap for termination)?
> Thanks for your comment! While working on the revision, can I clarify that regarding "signed integer wrap for termination", did you suggest to remove those nsw flags that are involved in the loop exit condition?
Removing the nsw flags would make things worse, since the loop seems to rely on sign wrap to terminate. The way it's written the loop body won't even get entered since the initial values of `c` and `e` would fail the `c && e` check. What I'm asking is to change this test to a more typical counted loop format, eg:

```
for (int i1 = 0, i2 = 0; i1 > n && i2 > m; i1++, i2++)
  for (int j1 = m; j >= 0;  j--)
     ...
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114916/new/

https://reviews.llvm.org/D114916



More information about the llvm-commits mailing list