1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -mattr=+v,+m -run-pass=instruction-select \
3 # RUN: -simplify-mir -verify-machineinstrs %s -o - | FileCheck %s
9 tracksRegLiveness: true
12 ; CHECK-LABEL: name: test_1
13 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
14 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
15 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
16 ; CHECK-NEXT: PseudoRET implicit $x10
17 %0:gprb(s64) = G_READ_VLENB
18 %1:gprb(s64) = G_CONSTANT i64 3
19 %2:gprb(s64) = G_LSHR %0, %1(s64)
21 PseudoRET implicit $x10
28 tracksRegLiveness: true
31 ; CHECK-LABEL: name: test_2
32 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
33 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 2
34 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
35 ; CHECK-NEXT: PseudoRET implicit $x10
36 %0:gprb(s64) = G_READ_VLENB
37 %1:gprb(s64) = G_CONSTANT i64 2
38 %2:gprb(s64) = G_LSHR %0, %1(s64)
40 PseudoRET implicit $x10
47 tracksRegLiveness: true
50 ; CHECK-LABEL: name: test_3
51 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
52 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 3
53 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 3
54 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[SRLI]], [[ADDI]]
55 ; CHECK-NEXT: $x10 = COPY [[MUL]]
56 ; CHECK-NEXT: PseudoRET implicit $x10
57 %0:gprb(s64) = G_READ_VLENB
58 %1:gprb(s64) = G_CONSTANT i64 3
59 %2:gprb(s64) = G_LSHR %0, %1(s64)
60 %3:gprb(s64) = G_CONSTANT i64 3
61 %4:gprb(s64) = G_MUL %2, %3
63 PseudoRET implicit $x10
70 tracksRegLiveness: true
73 ; CHECK-LABEL: name: test_4
74 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
75 ; CHECK-NEXT: [[SRLI:%[0-9]+]]:gpr = SRLI [[PseudoReadVLENB]], 1
76 ; CHECK-NEXT: $x10 = COPY [[SRLI]]
77 ; CHECK-NEXT: PseudoRET implicit $x10
78 %0:gprb(s64) = G_READ_VLENB
79 %1:gprb(s64) = G_CONSTANT i64 1
80 %2:gprb(s64) = G_LSHR %0, %1(s64)
82 PseudoRET implicit $x10
89 tracksRegLiveness: true
92 ; CHECK-LABEL: name: test_8
93 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
94 ; CHECK-NEXT: $x10 = COPY [[PseudoReadVLENB]]
95 ; CHECK-NEXT: PseudoRET implicit $x10
96 %0:gprb(s64) = G_READ_VLENB
98 PseudoRET implicit $x10
104 regBankSelected: true
105 tracksRegLiveness: true
108 ; CHECK-LABEL: name: test_16
109 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
110 ; CHECK-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[PseudoReadVLENB]], 1
111 ; CHECK-NEXT: $x10 = COPY [[SLLI]]
112 ; CHECK-NEXT: PseudoRET implicit $x10
113 %0:gprb(s64) = G_READ_VLENB
114 %1:gprb(s64) = G_CONSTANT i64 1
115 %2:gprb(s64) = G_SHL %0, %1(s64)
117 PseudoRET implicit $x10
123 regBankSelected: true
124 tracksRegLiveness: true
127 ; CHECK-LABEL: name: test_40
128 ; CHECK: [[PseudoReadVLENB:%[0-9]+]]:gpr = PseudoReadVLENB
129 ; CHECK-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI $x0, 5
130 ; CHECK-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[PseudoReadVLENB]], [[ADDI]]
131 ; CHECK-NEXT: $x10 = COPY [[MUL]]
132 ; CHECK-NEXT: PseudoRET implicit $x10
133 %0:gprb(s64) = G_READ_VLENB
134 %1:gprb(s64) = G_CONSTANT i64 5
135 %2:gprb(s64) = G_MUL %0, %1
137 PseudoRET implicit $x10