David Sherwood c0a7b15d01
[LV][NFC] Remove remaining uses of undef in tests (#169357)
Split off from PR #163525, this standalone patch replaces almost all the
remaining cases where undef is used as value in loop vectoriser tests.
This will reduce the likelihood of contributors hitting the `undef
deprecator` warning in github.
NOTE: The remaining use of undef in iv_outside_user.ll will be fixed in
a separate PR.

I've removed the test stride_undef from version-mem-access.ll, since
there is already a stride_poison test.
2025-11-26 11:24:10 +00:00

25 lines
831 B
LLVM

; RUN: opt < %s -passes=loop-vectorize -force-vector-interleave=1 -force-vector-width=4
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
define void @test(ptr %p, i1 %arg) {
entry:
br i1 %arg, label %while.end, label %while.body.lr.ph
while.body.lr.ph:
br label %while.body
while.body:
%it.sroa.0.091 = phi ptr [ %p, %while.body.lr.ph ], [ %incdec.ptr.i, %while.body ]
%incdec.ptr.i = getelementptr inbounds i32, ptr %it.sroa.0.091, i64 1
%inc32 = add i32 poison, 1 ; <------------- Make sure we don't set NSW flags to the poison.
%cmp.i11 = icmp eq ptr %incdec.ptr.i, poison
br i1 %cmp.i11, label %while.end, label %while.body
while.end:
ret void
}