1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s
5 define i32 @test_cmp_i8(i8 %a, i8 %b) {
6 %r = icmp ult i8 %a, %b
7 %res = zext i1 %r to i32
11 define i32 @test_cmp_i16(i16 %a, i16 %b) {
12 %r = icmp ult i16 %a, %b
13 %res = zext i1 %r to i32
17 define i32 @test_cmp_i32(i32 %a, i32 %b) {
18 %r = icmp ult i32 %a, %b
19 %res = zext i1 %r to i32
23 define i32 @test_cmp_i64(i64 %a, i64 %b) {
24 %r = icmp ult i64 %a, %b
25 %res = zext i1 %r to i32
29 define i32 @test_cmp_p0(i32* %a, i32* %b) {
30 %r = icmp ult i32* %a, %b
31 %res = zext i1 %r to i32
40 regBankSelected: false
50 ; CHECK-LABEL: name: test_cmp_i8
51 ; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
52 ; CHECK: [[COPY1:%[0-9]+]]:_(s8) = COPY $sil
53 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[COPY]](s8), [[COPY1]]
54 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ICMP]](s1)
55 ; CHECK: $eax = COPY [[ZEXT]](s32)
56 ; CHECK: RET 0, implicit $eax
59 %2(s1) = G_ICMP intpred(ult), %0(s8), %1
60 %3(s32) = G_ZEXT %2(s1)
69 regBankSelected: false
79 ; CHECK-LABEL: name: test_cmp_i16
80 ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $di
81 ; CHECK: [[COPY1:%[0-9]+]]:_(s16) = COPY $si
82 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[COPY]](s16), [[COPY1]]
83 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ICMP]](s1)
84 ; CHECK: $eax = COPY [[ZEXT]](s32)
85 ; CHECK: RET 0, implicit $eax
88 %2(s1) = G_ICMP intpred(ult), %0(s16), %1
89 %3(s32) = G_ZEXT %2(s1)
98 regBankSelected: false
100 - { id: 0, class: _ }
101 - { id: 1, class: _ }
102 - { id: 2, class: _ }
103 - { id: 3, class: _ }
108 ; CHECK-LABEL: name: test_cmp_i32
109 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
110 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
111 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY1]]
112 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ICMP]](s1)
113 ; CHECK: $eax = COPY [[ZEXT]](s32)
114 ; CHECK: RET 0, implicit $eax
117 %2(s1) = G_ICMP intpred(ult), %0(s32), %1
118 %3(s32) = G_ZEXT %2(s1)
127 regBankSelected: false
129 - { id: 0, class: _ }
130 - { id: 1, class: _ }
131 - { id: 2, class: _ }
132 - { id: 3, class: _ }
137 ; CHECK-LABEL: name: test_cmp_i64
138 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $rdi
139 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $rsi
140 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[COPY]](s64), [[COPY1]]
141 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ICMP]](s1)
142 ; CHECK: $eax = COPY [[ZEXT]](s32)
143 ; CHECK: RET 0, implicit $eax
146 %2(s1) = G_ICMP intpred(ult), %0(s64), %1
147 %3(s32) = G_ZEXT %2(s1)
156 regBankSelected: false
158 - { id: 0, class: _ }
159 - { id: 1, class: _ }
160 - { id: 2, class: _ }
161 - { id: 3, class: _ }
166 ; CHECK-LABEL: name: test_cmp_p0
167 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $rdi
168 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $rsi
169 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[COPY]](p0), [[COPY1]]
170 ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[ICMP]](s1)
171 ; CHECK: $eax = COPY [[ZEXT]](s32)
172 ; CHECK: RET 0, implicit $eax
175 %2(s1) = G_ICMP intpred(ult), %0(p0), %1
176 %3(s32) = G_ZEXT %2(s1)