Skip to content

LoopVectorize: add test for crash in #72969 #74111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions llvm/test/Transforms/LoopVectorize/X86/pr72969.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
; RUN: not --crash opt -mtriple=x86_64 -mattr=-avx,-avx2,-avx512f,+sse,-sse2,-sse3,-sse4.2 -passes=loop-vectorize -S < %s
; 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

@h = global i64 0

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 i64, ptr %p, i64 %add
store i64 0, ptr %arrayidx
%inc = add i16 %inc.merge, 1
%idx = zext i16 %inc to i64
%gep = getelementptr i64, ptr %p, i64 %idx
%cmp = icmp ugt ptr %gep, @h
br i1 %cmp, label %exit, label %for.body

exit:
ret void
}