Skip to content

Commit 8ad4df8

Browse files
committed
[RISCV][GISel] Add s32 G_SELECT instruction select test for RV64. NFC
1 parent 48c5c1b commit 8ad4df8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/select-rv64.mir

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
22
# RUN: llc -mtriple=riscv64 -run-pass=instruction-select %s -o - \
33
# RUN: | FileCheck %s
4+
5+
---
6+
name: select_s32
7+
legalized: true
8+
regBankSelected: true
9+
tracksRegLiveness: true
10+
body: |
11+
bb.0:
12+
liveins: $x10, $x11, $x12
13+
14+
; CHECK-LABEL: name: select_s32
15+
; CHECK: liveins: $x10, $x11, $x12
16+
; CHECK-NEXT: {{ $}}
17+
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
18+
; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
19+
; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x12
20+
; CHECK-NEXT: [[Select_GPR_Using_CC_GPR:%[0-9]+]]:gpr = Select_GPR_Using_CC_GPR [[COPY]], $x0, 1, [[COPY1]], [[COPY2]]
21+
; CHECK-NEXT: $x10 = COPY [[Select_GPR_Using_CC_GPR]]
22+
; CHECK-NEXT: PseudoRET implicit $x10
23+
%0:gprb(s64) = COPY $x10
24+
%1:gprb(s64) = COPY $x11
25+
%2:gprb(s64) = COPY $x12
26+
%3:gprb(s32) = G_TRUNC %1
27+
%4:gprb(s32) = G_TRUNC %2
28+
%5:gprb(s32) = G_SELECT %0, %3, %4
29+
%6:gprb(s64) = G_ANYEXT %5
30+
$x10 = COPY %6(s64)
31+
PseudoRET implicit $x10
32+
33+
...
434
---
535
name: select_s64
636
legalized: true

0 commit comments

Comments
 (0)