[PATCH] D120882: fix overflow in example code.

pl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 20 20:01:47 PDT 2022


0x00-pl updated this revision to Diff 416815.

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

https://reviews.llvm.org/D120882

Files:
  llvm/lib/Transforms/Scalar/LoopInterchange.cpp


Index: llvm/lib/Transforms/Scalar/LoopInterchange.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -1067,8 +1067,8 @@
             continue;
 
           // If we find the inner induction after an outer induction e.g.
-          // for(int i=0;i<N;i++)
-          //   for(int j=0;j<N;j++)
+          // for(int i=1;i<N;i++)
+          //   for(int j=1;j<N;j++)
           //     A[i][j] = A[i-1][j-1]+k;
           // then it is a good order.
           if (AR->getLoop() == InnerLoop) {
@@ -1081,8 +1081,8 @@
             }
           }
           // If we find the outer induction after an inner induction e.g.
-          // for(int i=0;i<N;i++)
-          //   for(int j=0;j<N;j++)
+          // for(int i=1;i<N;i++)
+          //   for(int j=1;j<N;j++)
           //     A[j][i] = A[j-1][i-1]+k;
           // then it is a bad order.
           if (AR->getLoop() == OuterLoop) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120882.416815.patch
Type: text/x-patch
Size: 1012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220321/ce607f65/attachment.bin>


More information about the llvm-commits mailing list