[llvm] ad2cad1 - [LV] Add test with IV that needs scalar steps and user outside of loop.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 28 01:46:41 PST 2022


Author: Florian Hahn
Date: 2022-02-28T09:46:18Z
New Revision: ad2cad1c521c4a715f9d40a70bf891b93c26ab47

URL: https://github.com/llvm/llvm-project/commit/ad2cad1c521c4a715f9d40a70bf891b93c26ab47
DIFF: https://github.com/llvm/llvm-project/commit/ad2cad1c521c4a715f9d40a70bf891b93c26ab47.diff

LOG: [LV] Add test with IV that needs scalar steps and user outside of loop.

Also add a run line to check interleaving only. This test covers the PPC
buildbot failures caused by 49b23f451cf71.

Added: 
    

Modified: 
    llvm/test/Transforms/LoopVectorize/iv_outside_user.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll b/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
index e4385940e7585..a296048cfa3ea 100644
--- a/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
+++ b/llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
@@ -1,4 +1,5 @@
 ; RUN: opt -S -loop-vectorize -force-vector-interleave=1 -force-vector-width=2 < %s | FileCheck %s
+; RUN: opt -S -loop-vectorize -force-vector-interleave=2 -force-vector-width=1 < %s | FileCheck %s
 
 ; CHECK-LABEL: @postinc
 ; CHECK-LABEL: scalar.ph:
@@ -174,3 +175,26 @@ BB4:
   %tmp15 = icmp sgt i32 %tmp14, 0
   br i1 %tmp15, label %BB4, label %BB1
 }
+
+; CHECK-LABEL: @iv_scalar_steps_and_outside_users
+; CHECK-LABEL: scalar.ph:
+; CHECK-NEXT:    %bc.resume.val = phi i64 [ 1002, %middle.block ], [ 0, %entry ]
+; CHECK-LABEL: exit:
+; CHECK-NEXT:    %iv.lcssa = phi i64 [ %iv, %loop ], [ 1001, %middle.block ]
+;
+define i64 @iv_scalar_steps_and_outside_users(i64* %ptr) {
+entry:
+  br label %loop
+
+loop:
+  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
+  %iv.next = add nuw i64 %iv, 1
+  %gep.ptr = getelementptr inbounds i64, i64* %ptr, i64 %iv
+  store i64 %iv, i64* %gep.ptr
+  %exitcond = icmp ugt i64 %iv, 1000
+  br i1 %exitcond, label %exit, label %loop
+
+exit:
+  %iv.lcssa = phi i64 [ %iv, %loop ]
+  ret i64 %iv.lcssa
+}


        


More information about the llvm-commits mailing list