[llvm] a4bb037 - [LV] Add test where pointer is incorrectly marked as uniform.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 17 07:24:32 PDT 2023
Author: Florian Hahn
Date: 2023-03-17T14:24:13Z
New Revision: a4bb0374189a4121508beebf1cfb59875ece45cd
URL: https://github.com/llvm/llvm-project/commit/a4bb0374189a4121508beebf1cfb59875ece45cd
DIFF: https://github.com/llvm/llvm-project/commit/a4bb0374189a4121508beebf1cfb59875ece45cd.diff
LOG: [LV] Add test where pointer is incorrectly marked as uniform.
Test for #61396.
Added:
Modified:
llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll b/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
index e4129747898b..8431972f78ee 100644
--- a/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
+++ b/llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
@@ -481,3 +481,34 @@ for.body:
for.end:
ret void
}
+
+
+; FIXME: Currently %cur.ptr is incorrectly identified as uniform.
+
+; CHECK-LABEL: pr61396_pointer_used_as_both_stored_value_and_pointer_operand_by_store
+; CHECK: LV: Found uniform instruction: %cur.ptr = getelementptr inbounds ptr, ptr %ary, i64 %iv
+
+; CHECK: define void @pr61396_pointer_used_as_both_stored_value_and_pointer_operand_by_store(
+; CHECK: vector.body:
+; CHECK-NEXT: %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
+; CHECK-NEXT: [[GEP:%.+]] = getelementptr inbounds ptr, ptr %ary, i64 %index
+; CHECK-NEXT: [[INS:%.+]] = insertelement <4 x ptr> poison, ptr [[GEP]], i64 0
+; CHECK-NEXT: [[SPLAT:%.+]] = shufflevector <4 x ptr> %broadcast.splatinsert, <4 x ptr> poison, <4 x i32> zeroinitializer
+; CHECK-NEXT: store <4 x ptr> [[SPLAT]], ptr [[GEP]], align 8
+;
+
+define void @pr61396_pointer_used_as_both_stored_value_and_pointer_operand_by_store(ptr %ary) {
+entry:
+ br label %loop
+
+loop:
+ %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
+ %cur.ptr = getelementptr inbounds ptr, ptr %ary, i64 %iv
+ store ptr %cur.ptr, ptr %cur.ptr, align 8
+ %iv.next = add nuw nsw i64 %iv, 1
+ %done = icmp eq i64 %iv, 10240
+ br i1 %done, label %exit, label %loop
+
+exit:
+ ret void
+}
More information about the llvm-commits
mailing list