[PATCH] D120882: fix overflow in example code.

pl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 02:40:21 PST 2022


0x00-pl created this revision.
0x00-pl added a project: LLVM.
Herald added a subscriber: hiraditya.
Herald added a project: All.
0x00-pl requested review of this revision.
Herald added a subscriber: llvm-commits.

fix overflow in example code in 'llvm/lib/Transforms/Scalar/LoopInterchange.cpp'


Repository:
  rG LLVM Github Monorepo

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
@@ -1069,8 +1069,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) {
@@ -1083,8 +1083,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.412647.patch
Type: text/x-patch
Size: 1012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220303/fd335c7b/attachment.bin>


More information about the llvm-commits mailing list