Debian Codegraph @

llvm/test/CodeGen/RISCV/GlobalISel/legalizer/legalize-threeway-cmp-rv64.mir

raw
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2 # RUN: llc -mtriple=riscv64 -run-pass=legalizer %s -o - | FileCheck %s
3
4 ---
5 name: test_ucmp_i32
6 body: |
7 bb.1:
8 liveins: $x10, $x11
9
10 ; CHECK-LABEL: name: test_ucmp_i32
11 ; CHECK: liveins: $x10, $x11
12 ; CHECK-NEXT: {{ $}}
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
14 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
15 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
16 ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32
17 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[SEXT_INREG]](s64), [[SEXT_INREG1]]
18 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(slt), [[SEXT_INREG]](s64), [[SEXT_INREG1]]
19 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ICMP]], [[ICMP1]]
20 ; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 32
21 ; CHECK-NEXT: $x10 = COPY [[SEXT_INREG2]](s64)
22 ; CHECK-NEXT: PseudoRET implicit $x10
23 %2:_(s64) = COPY $x10
24 %0:_(s32) = G_TRUNC %2(s64)
25 %3:_(s64) = COPY $x11
26 %1:_(s32) = G_TRUNC %3(s64)
27 %4:_(s32) = G_SCMP %0(s32), %1
28 %5:_(s64) = G_SEXT %4(s32)
29 $x10 = COPY %5(s64)
30 PseudoRET implicit $x10
31
32 ...
33 ---
34 name: test_scmp_i32
35 body: |
36 bb.1:
37 liveins: $x10, $x11
38
39 ; CHECK-LABEL: name: test_scmp_i32
40 ; CHECK: liveins: $x10, $x11
41 ; CHECK-NEXT: {{ $}}
42 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
43 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11
44 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
45 ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY1]], 32
46 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(sgt), [[SEXT_INREG]](s64), [[SEXT_INREG1]]
47 ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s64) = G_ICMP intpred(slt), [[SEXT_INREG]](s64), [[SEXT_INREG1]]
48 ; CHECK-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ICMP]], [[ICMP1]]
49 ; CHECK-NEXT: [[SEXT_INREG2:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SUB]], 32
50 ; CHECK-NEXT: $x10 = COPY [[SEXT_INREG2]](s64)
51 ; CHECK-NEXT: PseudoRET implicit $x10
52 %2:_(s64) = COPY $x10
53 %0:_(s32) = G_TRUNC %2(s64)
54 %3:_(s64) = COPY $x11
55 %1:_(s32) = G_TRUNC %3(s64)
56 %4:_(s32) = G_SCMP %0(s32), %1
57 %5:_(s64) = G_SEXT %4(s32)
58 $x10 = COPY %5(s64)
59 PseudoRET implicit $x10
60
61 ...