1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=+d -run-pass=regbankselect \
3 # RUN: -simplify-mir -verify-machineinstrs %s \
4 # RUN: -o - | FileCheck -check-prefix=RV32I %s
9 tracksRegLiveness: true
12 liveins: $x10, $f10_f, $f11_f
14 ; RV32I-LABEL: name: fp_select_s32
15 ; RV32I: liveins: $x10, $f10_f, $f11_f
17 ; RV32I-NEXT: [[COPY:%[0-9]+]]:gprb(s32) = COPY $x10
18 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f10_f
19 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f11_f
20 ; RV32I-NEXT: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
21 ; RV32I-NEXT: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY]], [[C]]
22 ; RV32I-NEXT: [[SELECT:%[0-9]+]]:fprb(s32) = G_SELECT [[AND]](s32), [[COPY1]], [[COPY2]]
23 ; RV32I-NEXT: $f10_f = COPY [[SELECT]](s32)
24 ; RV32I-NEXT: PseudoRET implicit $f10_f
26 %4:_(s32) = COPY $f10_f
27 %5:_(s32) = COPY $f11_f
28 %12:_(s32) = G_CONSTANT i32 1
29 %11:_(s32) = G_AND %3, %12
30 %10:_(s32) = G_SELECT %11(s32), %4, %5
31 $f10_f = COPY %10(s32)
32 PseudoRET implicit $f10_f
38 tracksRegLiveness: true
41 liveins: $x10, $f10_d, $f11_d
43 ; RV32I-LABEL: name: fp_select_s64
44 ; RV32I: liveins: $x10, $f10_d, $f11_d
46 ; RV32I-NEXT: [[COPY:%[0-9]+]]:gprb(s32) = COPY $x10
47 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:fprb(s64) = COPY $f10_d
48 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:fprb(s64) = COPY $f11_d
49 ; RV32I-NEXT: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
50 ; RV32I-NEXT: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY]], [[C]]
51 ; RV32I-NEXT: [[SELECT:%[0-9]+]]:fprb(s64) = G_SELECT [[AND]](s32), [[COPY1]], [[COPY2]]
52 ; RV32I-NEXT: $f10_d = COPY [[SELECT]](s64)
53 ; RV32I-NEXT: PseudoRET implicit $f10_d
55 %4:_(s64) = COPY $f10_d
56 %5:_(s64) = COPY $f11_d
57 %12:_(s32) = G_CONSTANT i32 1
58 %11:_(s32) = G_AND %3, %12
59 %10:_(s64) = G_SELECT %11(s32), %4, %5
60 $f10_d = COPY %10(s64)
61 PseudoRET implicit $f10_d
65 name: fp_select_gpr_use_s32
67 tracksRegLiveness: true
70 liveins: $x10, $f10_f, $f11_f
72 ; RV32I-LABEL: name: fp_select_gpr_use_s32
73 ; RV32I: liveins: $x10, $f10_f, $f11_f
75 ; RV32I-NEXT: [[COPY:%[0-9]+]]:gprb(s32) = COPY $x10
76 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f10_f
77 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:fprb(s32) = COPY $f11_f
78 ; RV32I-NEXT: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
79 ; RV32I-NEXT: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY]], [[C]]
80 ; RV32I-NEXT: [[SELECT:%[0-9]+]]:fprb(s32) = G_SELECT [[AND]](s32), [[COPY1]], [[COPY2]]
81 ; RV32I-NEXT: $x10 = COPY [[SELECT]](s32)
82 ; RV32I-NEXT: PseudoRET implicit $x10
84 %4:_(s32) = COPY $f10_f
85 %5:_(s32) = COPY $f11_f
86 %12:_(s32) = G_CONSTANT i32 1
87 %11:_(s32) = G_AND %3, %12
88 %10:_(s32) = G_SELECT %11(s32), %4, %5
90 PseudoRET implicit $x10
94 name: fp_select_gpr_def_s32
96 tracksRegLiveness: true
99 liveins: $x10, $x11, $f10_f
101 ; RV32I-LABEL: name: fp_select_gpr_def_s32
102 ; RV32I: liveins: $x10, $x11, $f10_f
104 ; RV32I-NEXT: [[COPY:%[0-9]+]]:gprb(s32) = COPY $x10
105 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f10_f
106 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:gprb(s32) = COPY $x11
107 ; RV32I-NEXT: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
108 ; RV32I-NEXT: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY]], [[C]]
109 ; RV32I-NEXT: [[COPY3:%[0-9]+]]:fprb(s32) = COPY [[COPY2]](s32)
110 ; RV32I-NEXT: [[SELECT:%[0-9]+]]:fprb(s32) = G_SELECT [[AND]](s32), [[COPY1]], [[COPY3]]
111 ; RV32I-NEXT: $f10_f = COPY [[SELECT]](s32)
112 ; RV32I-NEXT: PseudoRET implicit $f10_f
113 %3:_(s32) = COPY $x10
114 %4:_(s32) = COPY $f10_f
115 %5:_(s32) = COPY $x11
116 %12:_(s32) = G_CONSTANT i32 1
117 %11:_(s32) = G_AND %3, %12
118 %10:_(s32) = G_SELECT %11(s32), %4, %5
119 $f10_f = COPY %10(s32)
120 PseudoRET implicit $f10_f
124 name: fp_select_only_fpr_use_s32
126 tracksRegLiveness: true
129 liveins: $x10, $x11, $x12
131 ; RV32I-LABEL: name: fp_select_only_fpr_use_s32
132 ; RV32I: liveins: $x10, $x11, $x12
134 ; RV32I-NEXT: [[COPY:%[0-9]+]]:gprb(s32) = COPY $x10
135 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:gprb(s32) = COPY $x11
136 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:gprb(s32) = COPY $x12
137 ; RV32I-NEXT: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
138 ; RV32I-NEXT: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY]], [[C]]
139 ; RV32I-NEXT: [[SELECT:%[0-9]+]]:gprb(s32) = G_SELECT [[AND]](s32), [[COPY1]], [[COPY2]]
140 ; RV32I-NEXT: $f10_f = COPY [[SELECT]](s32)
141 ; RV32I-NEXT: PseudoRET implicit $f10_f
142 %3:_(s32) = COPY $x10
143 %4:_(s32) = COPY $x11
144 %5:_(s32) = COPY $x12
145 %12:_(s32) = G_CONSTANT i32 1
146 %11:_(s32) = G_AND %3, %12
147 %10:_(s32) = G_SELECT %11(s32), %4, %5
148 $f10_f = COPY %10(s32)
149 PseudoRET implicit $f10_f
153 name: fp_select_only_one_fpr_def_s32
155 tracksRegLiveness: true
158 liveins: $x10, $x11, $f10_f
160 ; RV32I-LABEL: name: fp_select_only_one_fpr_def_s32
161 ; RV32I: liveins: $x10, $x11, $f10_f
163 ; RV32I-NEXT: [[COPY:%[0-9]+]]:gprb(s32) = COPY $x10
164 ; RV32I-NEXT: [[COPY1:%[0-9]+]]:fprb(s32) = COPY $f10_f
165 ; RV32I-NEXT: [[COPY2:%[0-9]+]]:gprb(s32) = COPY $x11
166 ; RV32I-NEXT: [[C:%[0-9]+]]:gprb(s32) = G_CONSTANT i32 1
167 ; RV32I-NEXT: [[AND:%[0-9]+]]:gprb(s32) = G_AND [[COPY]], [[C]]
168 ; RV32I-NEXT: [[COPY3:%[0-9]+]]:gprb(s32) = COPY [[COPY1]](s32)
169 ; RV32I-NEXT: [[SELECT:%[0-9]+]]:gprb(s32) = G_SELECT [[AND]](s32), [[COPY3]], [[COPY2]]
170 ; RV32I-NEXT: $x10 = COPY [[SELECT]](s32)
171 ; RV32I-NEXT: PseudoRET implicit $x10
172 %3:_(s32) = COPY $x10
173 %4:_(s32) = COPY $f10_f
174 %5:_(s32) = COPY $x11
175 %12:_(s32) = G_CONSTANT i32 1
176 %11:_(s32) = G_AND %3, %12
177 %10:_(s32) = G_SELECT %11(s32), %4, %5
179 PseudoRET implicit $x10