1 # RUN: llc -mtriple arm-- -run-pass=legalizer %s -o - | FileCheck %s
2 # RUN: llc -mtriple thumb-- -mattr=+v6t2 -run-pass=legalizer %s -o - | FileCheck %s
4 define void @test_icmp_s8() { ret void }
5 define void @test_icmp_s16() { ret void }
6 define void @test_icmp_s32() { ret void }
8 define void @test_icmp_p0() { ret void }
12 # CHECK-LABEL: name: test_icmp_s8
14 # CHECK: legalized: true
15 regBankSelected: false
17 tracksRegLiveness: true
30 %1(s8) = G_LOAD %0 :: (load (s8))
32 %3(s8) = G_LOAD %2 :: (load (s8))
33 %4(s1) = G_ICMP intpred(ne), %1(s8), %3
34 ; G_ICMP with s8 should widen
35 ; CHECK: {{%[0-9]+}}:_(s1) = G_ICMP intpred(ne), {{%[0-9]+}}(s32), {{%[0-9]+}}
36 ; CHECK-NOT: {{%[0-9]+}}:_(s1) = G_ICMP intpred(ne), {{%[0-9]+}}(s8), {{%[0-9]+}}
37 %5(s32) = G_ZEXT %4(s1)
39 BX_RET 14, $noreg, implicit $r0
43 # CHECK-LABEL: name: test_icmp_s16
45 # CHECK: legalized: true
46 regBankSelected: false
48 tracksRegLiveness: true
61 %1(s16) = G_LOAD %0 :: (load (s16))
63 %3(s16) = G_LOAD %2 :: (load (s16))
64 %4(s1) = G_ICMP intpred(slt), %1(s16), %3
65 ; G_ICMP with s16 should widen
66 ; CHECK: {{%[0-9]+}}:_(s1) = G_ICMP intpred(slt), {{%[0-9]+}}(s32), {{%[0-9]+}}
67 ; CHECK-NOT: {{%[0-9]+}}:_(s1) = G_ICMP intpred(slt), {{%[0-9]+}}(s16), {{%[0-9]+}}
68 %5(s32) = G_ZEXT %4(s1)
70 BX_RET 14, $noreg, implicit $r0
74 # CHECK-LABEL: name: test_icmp_s32
76 # CHECK: legalized: true
77 regBankSelected: false
79 tracksRegLiveness: true
91 %2(s1) = G_ICMP intpred(eq), %0(s32), %1
92 ; G_ICMP with s32 is legal, so we should find it unchanged in the output
93 ; CHECK: {{%[0-9]+}}:_(s1) = G_ICMP intpred(eq), {{%[0-9]+}}(s32), {{%[0-9]+}}
94 %3(s32) = G_ZEXT %2(s1)
96 BX_RET 14, $noreg, implicit $r0
100 # CHECK-LABEL: name: test_icmp_p0
102 # CHECK: legalized: true
103 regBankSelected: false
105 tracksRegLiveness: true
107 - { id: 0, class: _ }
108 - { id: 1, class: _ }
109 - { id: 2, class: _ }
110 - { id: 3, class: _ }
117 %2(s1) = G_ICMP intpred(eq), %0(p0), %1
118 ; G_ICMP with p0 is legal, so we should find it unchanged in the output
119 ; CHECK: {{%[0-9]+}}:_(s1) = G_ICMP intpred(eq), {{%[0-9]+}}(p0), {{%[0-9]+}}
120 %3(s32) = G_ZEXT %2(s1)
122 BX_RET 14, $noreg, implicit $r0