[llvm] LoopVectorize/test: add test for crash in #72969 (PR #74111)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 09:28:17 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Ramkumar Ramachandra (artagnon)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/74111.diff


1 Files Affected:

- (added) llvm/test/Transforms/LoopVectorize/pr72969.ll (+26) 


``````````diff
diff --git a/llvm/test/Transforms/LoopVectorize/pr72969.ll b/llvm/test/Transforms/LoopVectorize/pr72969.ll
new file mode 100644
index 000000000000000..47d3efc10fc4c49
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/pr72969.ll
@@ -0,0 +1,26 @@
+; RUN: not --crash opt -passes=loop-vectorize -S < %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+ at h = global i32 0, align 4
+
+define void @test(ptr %p) {
+entry:
+  br label %for.body
+
+for.body:
+  %idx.ext.merge = phi i64 [ 1, %entry ], [ %idx, %for.body ]
+  %inc.merge = phi i16 [ 1, %entry ], [ %inc, %for.body ]
+  %idx.merge = phi i64 [ 0, %entry ], [ %idx.ext.merge, %for.body ]
+  %add = shl i64 %idx.merge, 1
+  %arrayidx = getelementptr [1 x i32], ptr %p, i64 0, i64 %add
+  %0 = load i32, ptr %arrayidx, align 4
+  %inc = add i16 %inc.merge, 1
+  %idx = zext i16 %inc to i64
+  %gep = getelementptr i32, ptr %p, i64 %idx
+  %cmp = icmp ugt ptr %gep, @h
+  br i1 %cmp, label %exit, label %for.body
+
+exit:
+  ret void
+}

``````````

</details>


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


More information about the llvm-commits mailing list