1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -mattr=+v,+m -run-pass=legalizer %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: test_1
10 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
11 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
12 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[READ_VLENB]], [[C]](s64)
13 ; CHECK-NEXT: $x10 = COPY [[LSHR]](s64)
14 ; CHECK-NEXT: PseudoRET implicit $x10
15 %0:_(s64) = G_VSCALE i64 1
17 PseudoRET implicit $x10
24 ; CHECK-LABEL: name: test_2
25 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
26 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
27 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[READ_VLENB]], [[C]](s64)
28 ; CHECK-NEXT: $x10 = COPY [[LSHR]](s64)
29 ; CHECK-NEXT: PseudoRET implicit $x10
30 %0:_(s64) = G_VSCALE i64 2
32 PseudoRET implicit $x10
39 ; CHECK-LABEL: name: test_3
40 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
41 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3
42 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[READ_VLENB]], [[C]](s64)
43 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[LSHR]], [[C]]
44 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
45 ; CHECK-NEXT: PseudoRET implicit $x10
46 %0:_(s64) = G_VSCALE i64 3
48 PseudoRET implicit $x10
55 ; CHECK-LABEL: name: test_4
56 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
57 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
58 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[READ_VLENB]], [[C]](s64)
59 ; CHECK-NEXT: $x10 = COPY [[LSHR]](s64)
60 ; CHECK-NEXT: PseudoRET implicit $x10
61 %0:_(s64) = G_VSCALE i64 4
63 PseudoRET implicit $x10
70 ; CHECK-LABEL: name: test_8
71 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
72 ; CHECK-NEXT: $x10 = COPY [[READ_VLENB]](s64)
73 ; CHECK-NEXT: PseudoRET implicit $x10
74 %0:_(s64) = G_VSCALE i64 8
76 PseudoRET implicit $x10
83 ; CHECK-LABEL: name: test_16
84 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
85 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
86 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[READ_VLENB]], [[C]](s64)
87 ; CHECK-NEXT: $x10 = COPY [[SHL]](s64)
88 ; CHECK-NEXT: PseudoRET implicit $x10
89 %0:_(s64) = G_VSCALE i64 16
91 PseudoRET implicit $x10
98 ; CHECK-LABEL: name: test_40
99 ; CHECK: [[READ_VLENB:%[0-9]+]]:_(s64) = G_READ_VLENB
100 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 5
101 ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[READ_VLENB]], [[C]]
102 ; CHECK-NEXT: $x10 = COPY [[MUL]](s64)
103 ; CHECK-NEXT: PseudoRET implicit $x10
104 %0:_(s64) = G_VSCALE i64 40
106 PseudoRET implicit $x10