1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -start-after codegenprepare -mtriple=riscv64 -mattr=-v -o - %s | FileCheck --check-prefix=CHECK-NOV %s
3 ; RUN: llc -start-after codegenprepare -mtriple=riscv64 -mattr=+v -o - %s | FileCheck --check-prefix=CHECK-V %s
5 ; Reproducer for https://github.com/llvm/llvm-project/issues/55168.
6 ; We should always return 1 (and not -1).
7 define i32 @test(i32 %call.i) {
8 ; CHECK-NOV-LABEL: test:
10 ; CHECK-NOV-NEXT: li a0, 1
13 ; CHECK-V-LABEL: test:
15 ; CHECK-V-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
16 ; CHECK-V-NEXT: vmv.v.x v8, a0
17 ; CHECK-V-NEXT: lui a0, 524288
18 ; CHECK-V-NEXT: vslide1down.vx v8, v8, a0
19 ; CHECK-V-NEXT: addi a0, a0, 2
20 ; CHECK-V-NEXT: vmslt.vx v0, v8, a0
21 ; CHECK-V-NEXT: vmv.v.i v8, 0
22 ; CHECK-V-NEXT: vmerge.vim v8, v8, 1, v0
23 ; CHECK-V-NEXT: vslidedown.vi v8, v8, 1
24 ; CHECK-V-NEXT: vmv.x.s a0, v8
26 %t2 = insertelement <2 x i32> <i32 poison, i32 -2147483648>, i32 %call.i, i64 0
27 %t3 = icmp slt <2 x i32> %t2, <i32 -2147483646, i32 -2147483646>
28 %t4 = zext <2 x i1> %t3 to <2 x i32>
29 %t6 = extractelement <2 x i32> %t4, i64 1