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: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm 13132
62 ; CHECK: $xzr = SUBSXrr [[COPY]], [[MOVi64imm]], implicit-def $nzcv
63 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
64 ; CHECK: $w0 = COPY [[CSINCWr]]
65 ; CHECK: RET_ReallyLR implicit $w0
66 %0:gpr(s64) = COPY $x0
67 %1:gpr(s64) = G_CONSTANT i64 13132
68 %5:gpr(s32) = G_ICMP intpred(eq), %0(s64), %1
70 RET_ReallyLR implicit $w0
74 name: cmp_imm_lookthrough
77 tracksRegLiveness: true
81 ; CHECK-LABEL: name: cmp_imm_lookthrough
83 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
84 ; CHECK: $wzr = SUBSWri [[COPY]], 42, 0, implicit-def $nzcv
85 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
86 ; CHECK: $w0 = COPY [[CSINCWr]]
87 ; CHECK: RET_ReallyLR implicit $w0
88 %0:gpr(s32) = COPY $w0
89 %1:gpr(s64) = G_CONSTANT i64 42
90 %2:gpr(s32) = G_TRUNC %1(s64)
91 %5:gpr(s32) = G_ICMP intpred(eq), %0(s32), %2
93 RET_ReallyLR implicit $w0
97 name: cmp_imm_lookthrough_bad_trunc
100 tracksRegLiveness: true
104 ; CHECK-LABEL: name: cmp_imm_lookthrough_bad_trunc
105 ; CHECK: liveins: $w0
106 ; CHECK: [[COPY:%[0-9]+]]:gpr32sp = COPY $w0
107 ; CHECK: $wzr = SUBSWri [[COPY]], 0, 0, implicit-def $nzcv
108 ; CHECK: [[CSINCWr:%[0-9]+]]:gpr32 = CSINCWr $wzr, $wzr, 1, implicit $nzcv
109 ; CHECK: $w0 = COPY [[CSINCWr]]
110 ; CHECK: RET_ReallyLR implicit $w0
111 %0:gpr(s32) = COPY $w0
112 %1:gpr(s64) = G_CONSTANT i64 68719476736 ; 0x1000000000
113 %2:gpr(s32) = G_TRUNC %1(s64) ; Value truncates to 0
114 %5:gpr(s32) = G_ICMP intpred(eq), %0(s32), %2
116 RET_ReallyLR implicit $w0