Skip to content

Commit 1afcfdf

Browse files
committed
LoopVectorize: add test for crash in #72969
1 parent 69066ab commit 1afcfdf

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; RUN: not --crash opt -mtriple=x86_64 -mattr=-avx,-avx2,-avx512f,+sse,-sse2,-sse3,-sse4.2 -passes=loop-vectorize -S < %s
2+
; RUN: not --crash opt -mtriple=x86_64 -mattr=-avx,-avx2,-avx512f,+sse,-sse2,-sse3,-sse4.2 -passes=loop-vectorize -force-vector-width=4 -S < %s
3+
4+
@h = global i64 0
5+
6+
define void @test(ptr %p) {
7+
entry:
8+
br label %for.body
9+
10+
for.body:
11+
%idx.ext.merge = phi i64 [ 1, %entry ], [ %idx, %for.body ]
12+
%inc.merge = phi i16 [ 1, %entry ], [ %inc, %for.body ]
13+
%idx.merge = phi i64 [ 0, %entry ], [ %idx.ext.merge, %for.body ]
14+
%add = shl i64 %idx.merge, 1
15+
%arrayidx = getelementptr i64, ptr %p, i64 %add
16+
store i64 0, ptr %arrayidx
17+
%inc = add i16 %inc.merge, 1
18+
%idx = zext i16 %inc to i64
19+
%gep = getelementptr i64, ptr %p, i64 %idx
20+
%cmp = icmp ugt ptr %gep, @h
21+
br i1 %cmp, label %exit, label %for.body
22+
23+
exit:
24+
ret void
25+
}

0 commit comments

Comments
 (0)