[llvm] [LoopInterchange] Add tests for the vectorization profitability (NFC) (PR #133665)

Madhur Amilkanthwar via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 01:01:20 PDT 2025


================
@@ -0,0 +1,108 @@
+; RUN: opt < %s -passes=loop-interchange -cache-line-size=64 \
+; RUN:     -pass-remarks-output=%t -disable-output -loop-interchange-profitabilities=vectorize
+; RUN: FileCheck -input-file %t %s
+
+ at A = dso_local global [256 x [256 x float]] zeroinitializer
+ at B = dso_local global [256 x [256 x float]] zeroinitializer
+ at C = dso_local global [256 x [256 x float]] zeroinitializer
+
+; Check that the below loops are exchanged for vectorization.
+;
+; for (int i = 0; i < 256; i++) {
+;   for (int j = 1; j < 256; j++) {
+;     A[i][j] = A[i][j-1] + B[i][j];
+;     C[i][j] += 1;
+;   }
+; }
+;
+; FIXME: These loops are not exchanged at this time due to the problem of
+; profitablity heuristic for vectorization.
+
+; CHECK:      --- !Missed
+; CHECK-NEXT: Pass:            loop-interchange
+; CHECK-NEXT: Name:            InterchangeNotProfitable
+; CHECK-NEXT: Function:        interchange_necesasry_for_vectorization
----------------
madhur13490 wrote:

That is the function name. There is a typo in the function name not the remark.

https://github.com/llvm/llvm-project/pull/133665


More information about the llvm-commits mailing list