Skip to content

LV: add crash-test for incomplete cases in VPlan #93551

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

Closed
wants to merge 1 commit into from
Closed
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/vplan-incomplete-cases.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
; REQUIRES: asserts
; RUN: not --crash opt %s -passes=loop-vectorize -S

define void @vplan_incomplete_cases_tc3(i8 %x, i8 %y) {
entry:
br label %loop.header

loop.header: ; preds = %latch, %entry
%iv = phi i8 [ %iv.next, %latch ], [ 0, %entry ]
%and = and i8 %x, %y
%extract.t = trunc i8 %and to i1
br i1 %extract.t, label %latch, label %indirect.latch

indirect.latch: ; preds = %loop.header
br label %latch

latch: ; preds = %indirect.latch, loop.header
%iv.next = add i8 %iv, 1
%zext = zext i8 %iv to i32
%cmp = icmp ult i32 %zext, 2
br i1 %cmp, label %loop.header, label %exit

exit: ; preds = %latch
ret void
}
Loading