[llvm] [LoopInterchange] Motivating example for interchange enablement. NFC. (PR #171631)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 10 08:37:55 PST 2025
================
@@ -0,0 +1,543 @@
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 -pass-remarks-missed='loop-interchange' -pass-remarks-output=%t -S
+; RUN: FileCheck --input-file=%t %s
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
+
+; The IR test case below is a full and representative example of a more complex
+; loop nest structure where we would like to see loops 'j' and 'JL' get
+; interchanged. This is the pseudo-code of the loop nest to get and idea of
+; the stucture:
+;
+; for L=1 to NX
+; for M=1 to NY
+; for i=1 to NX
+; for j=1 to NY
+; for IL=1 to NX
+; for JL=1 to NY
+; GlobC(j,JL,M) + GlobG(j,JL,M) + GlobE(j,JL,M) + GlobI(j,JL,M)
+; End
+; End
+; End
+; End
+; // Stmt 2
+; // Stmt 3
+; // Stmt 4
+; End
+; End
----------------
kasuga-fj wrote:
Just to confirm, this is a Fortran-based pseudo code, right? If so, it would be helpful to clarify that the data is stored in column-major order.
https://github.com/llvm/llvm-project/pull/171631
More information about the llvm-commits
mailing list