1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: cmp_imm_32
14 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
15 ; CHECK: $wzr = SUBSWri [[COPY]], 42, 0, implicit-def $nzcv
16 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
17 ; CHECK: $w0 = COPY [[CSINCWr]]
18 ; CHECK: RET_ReallyLR implicit $w0
19 %0:gpr(s32) = COPY $w0
20 %1:gpr(s32) = G_CONSTANT i32 42
21 %5:gpr(s32) = G_ICMP intpred(eq), %0(s32), %1
23 RET_ReallyLR implicit $w0
30 tracksRegLiveness: true
35 ; CHECK-LABEL: name: cmp_imm_64
37 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
38 ; CHECK: $xzr = SUBSXri [[COPY]], 42, 0, implicit-def $nzcv
39 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
40 ; CHECK: $w0 = COPY [[CSINCWr]]
41 ; CHECK: RET_ReallyLR implicit $w0
42 %0:gpr(s64) = COPY $x0
43 %1:gpr(s64) = G_CONSTANT i64 42
44 %5:gpr(s32) = G_ICMP intpred(eq), %0(s64), %1
46 RET_ReallyLR implicit $w0
50 name: cmp_imm_out_of_range
53 tracksRegLiveness: true
58 ; CHECK-LABEL: name: cmp_imm_out_of_range
60 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
61 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 13132
62 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, [[MOVi32imm]], %subreg.sub_32
63 ; CHECK: $xzr = SUBSXrr [[COPY]], [[SUBREG_TO_REG]], implicit-def $nzcv
64 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
65 ; CHECK: $w0 = COPY [[CSINCWr]]
66 ; CHECK: RET_ReallyLR implicit $w0
67 %0:gpr(s64) = COPY $x0
68 %1:gpr(s64) = G_CONSTANT i64 13132
69 %5:gpr(s32) = G_ICMP intpred(eq), %0(s64), %1
71 RET_ReallyLR implicit $w0
75 name: cmp_imm_lookthrough
78 tracksRegLiveness: true
82 ; CHECK-LABEL: name: cmp_imm_lookthrough
84 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
85 ; CHECK: $wzr = SUBSWri [[COPY]], 42, 0, implicit-def $nzcv
86 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
87 ; CHECK: $w0 = COPY [[CSINCWr]]
88 ; CHECK: RET_ReallyLR implicit $w0
89 %0:gpr(s32) = COPY $w0
90 %1:gpr(s64) = G_CONSTANT i64 42
91 %2:gpr(s32) = G_TRUNC %1(s64)
92 %5:gpr(s32) = G_ICMP intpred(eq), %0(s32), %2
94 RET_ReallyLR implicit $w0
98 name: cmp_imm_lookthrough_bad_trunc
100 regBankSelected: true
101 tracksRegLiveness: true
105 ; CHECK-LABEL: name: cmp_imm_lookthrough_bad_trunc
106 ; CHECK: liveins: $w0
107 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
108 ; CHECK: $wzr = SUBSWri [[COPY]], 0, 0, implicit-def $nzcv
109 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
110 ; CHECK: $w0 = COPY [[CSINCWr]]
111 ; CHECK: RET_ReallyLR implicit $w0
112 %0:gpr(s32) = COPY $w0
113 %1:gpr(s64) = G_CONSTANT i64 68719476736 ; 0x1000000000
114 %2:gpr(s32) = G_TRUNC %1(s64) ; Value truncates to 0
115 %5:gpr(s32) = G_ICMP intpred(eq), %0(s32), %2
117 RET_ReallyLR implicit $w0