1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -debugify-and-strip-all-safe -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 # Check that we remove hints during selection.
11 tracksRegLiveness: true
16 ; CHECK-LABEL: name: assert_zext_gpr
17 ; CHECK: liveins: $w0, $w1
19 ; CHECK-NEXT: %copy:gpr32 = COPY $w0
20 ; CHECK-NEXT: $w1 = COPY %copy
21 ; CHECK-NEXT: RET_ReallyLR implicit $w1
22 %copy:gpr(s32) = COPY $w0
23 %copy_assert_zext:gpr(s32) = G_ASSERT_ZEXT %copy, 16
24 $w1 = COPY %copy_assert_zext(s32)
25 RET_ReallyLR implicit $w1
32 tracksRegLiveness: true
37 ; CHECK-LABEL: name: assert_zext_fpr
38 ; CHECK: liveins: $s0, $s1
40 ; CHECK-NEXT: %copy:fpr32 = COPY $s0
41 ; CHECK-NEXT: $s1 = COPY %copy
42 ; CHECK-NEXT: RET_ReallyLR implicit $s1
43 %copy:fpr(s32) = COPY $s0
44 %copy_assert_zext:fpr(s32) = G_ASSERT_ZEXT %copy, 16
45 $s1 = COPY %copy_assert_zext(s32)
46 RET_ReallyLR implicit $s1
50 name: assert_zext_in_between_cross_bank
53 tracksRegLiveness: true
58 ; CHECK-LABEL: name: assert_zext_in_between_cross_bank
59 ; CHECK: liveins: $s0, $w1
61 ; CHECK-NEXT: %copy:fpr32 = COPY $s0
62 ; CHECK-NEXT: $w1 = COPY %copy
63 ; CHECK-NEXT: RET_ReallyLR implicit $w1
64 %copy:fpr(s32) = COPY $s0
65 %copy_assert_zext:fpr(s32) = G_ASSERT_ZEXT %copy, 16
66 $w1 = COPY %copy_assert_zext(s32)
67 RET_ReallyLR implicit $w1
71 name: assert_zext_decided_dst_class
74 tracksRegLiveness: true
77 liveins: $w0, $w1, $w2
79 ; Users of G_ASSERT_ZEXT may end up deciding the destination register class.
80 ; Make sure that the source register class is constrained.
82 ; CHECK-LABEL: name: assert_zext_decided_dst_class
83 ; CHECK: liveins: $w0, $w1, $w2
85 ; CHECK-NEXT: %copy_with_rc:gpr32sp = COPY $w2
86 ; CHECK-NEXT: $w1 = COPY %copy_with_rc
87 ; CHECK-NEXT: RET_ReallyLR implicit $w1
88 %copy:gpr(s32) = COPY $w0
89 %copy_assert_zext:gpr(s32) = G_ASSERT_ZEXT %copy, 16
90 %copy_with_rc:gpr32sp(s32) = COPY $w2
91 $w1 = COPY %copy_with_rc(s32)
92 RET_ReallyLR implicit $w1
99 tracksRegLiveness: true
104 ; CHECK-LABEL: name: assert_sext_gpr
105 ; CHECK: liveins: $w0, $w1
107 ; CHECK-NEXT: %copy:gpr32 = COPY $w0
108 ; CHECK-NEXT: $w1 = COPY %copy
109 ; CHECK-NEXT: RET_ReallyLR implicit $w1
110 %copy:gpr(s32) = COPY $w0
111 %copy_assert_sext:gpr(s32) = G_ASSERT_SEXT %copy, 16
112 $w1 = COPY %copy_assert_sext(s32)
113 RET_ReallyLR implicit $w1
117 name: assert_sext_fpr
119 regBankSelected: true
120 tracksRegLiveness: true
125 ; CHECK-LABEL: name: assert_sext_fpr
126 ; CHECK: liveins: $s0, $s1
128 ; CHECK-NEXT: %copy:fpr32 = COPY $s0
129 ; CHECK-NEXT: $s1 = COPY %copy
130 ; CHECK-NEXT: RET_ReallyLR implicit $s1
131 %copy:fpr(s32) = COPY $s0
132 %copy_assert_sext:fpr(s32) = G_ASSERT_SEXT %copy, 16
133 $s1 = COPY %copy_assert_sext(s32)
134 RET_ReallyLR implicit $s1
138 name: assert_sext_in_between_cross_bank
140 regBankSelected: true
141 tracksRegLiveness: true
146 ; CHECK-LABEL: name: assert_sext_in_between_cross_bank
147 ; CHECK: liveins: $s0, $w1
149 ; CHECK-NEXT: %copy:fpr32 = COPY $s0
150 ; CHECK-NEXT: $w1 = COPY %copy
151 ; CHECK-NEXT: RET_ReallyLR implicit $w1
152 %copy:fpr(s32) = COPY $s0
153 %copy_assert_sext:fpr(s32) = G_ASSERT_SEXT %copy, 16
154 $w1 = COPY %copy_assert_sext(s32)
155 RET_ReallyLR implicit $w1
159 name: assert_sext_decided_dst_class
161 regBankSelected: true
162 tracksRegLiveness: true
165 liveins: $w0, $w1, $w2
167 ; Users of G_ASSERT_SEXT may end up deciding the destination register class.
168 ; Make sure that the source register class is constrained.
170 ; CHECK-LABEL: name: assert_sext_decided_dst_class
171 ; CHECK: liveins: $w0, $w1, $w2
173 ; CHECK-NEXT: %copy_with_rc:gpr32sp = COPY $w2
174 ; CHECK-NEXT: $w1 = COPY %copy_with_rc
175 ; CHECK-NEXT: RET_ReallyLR implicit $w1
176 %copy:gpr(s32) = COPY $w0
177 %copy_assert_sext:gpr(s32) = G_ASSERT_SEXT %copy, 16
178 %copy_with_rc:gpr32sp(s32) = COPY $w2
179 $w1 = COPY %copy_with_rc(s32)
180 RET_ReallyLR implicit $w1