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

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 09:27:46 PST 2023


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

None

>From 85c341ff3ddc1d5c16cf59d4b51d5695b9540e9b Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <Ramkumar.Ramachandra at imgtec.com>
Date: Fri, 1 Dec 2023 17:15:43 +0000
Subject: [PATCH] LoopVectorize/test: add test for crash in #72969

---
 llvm/test/Transforms/LoopVectorize/pr72969.ll | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 llvm/test/Transforms/LoopVectorize/pr72969.ll

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
+}



More information about the llvm-commits mailing list