1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s
7 tracksRegLiveness: true
10 machineFunctionInfo: {}
14 ; CHECK-LABEL: name: mul_to_lshr
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
18 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 61
19 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s64)
20 ; CHECK-NEXT: $x0 = COPY [[LSHR]](s64)
22 %1:_(s64) = G_CONSTANT i64 8
23 %2:_(s64) = G_UMULH %0, %1(s64)
27 name: mul_to_lshr_vector
29 tracksRegLiveness: true
32 machineFunctionInfo: {}
36 ; CHECK-LABEL: name: mul_to_lshr_vector
39 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
40 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 29
41 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
42 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(<4 x s32>) = G_LSHR [[COPY]], [[BUILD_VECTOR]](<4 x s32>)
43 ; CHECK-NEXT: $q0 = COPY [[LSHR]](<4 x s32>)
44 %0:_(<4 x s32>) = COPY $q0
45 %1:_(s32) = G_CONSTANT i32 8
46 %bv:_(<4 x s32>) = G_BUILD_VECTOR %1, %1, %1, %1
47 %2:_(<4 x s32>) = G_UMULH %0, %bv(<4 x s32>)
48 $q0 = COPY %2(<4 x s32>)
51 name: mul_to_lshr_vector_out_of_range_shift
53 tracksRegLiveness: true
56 machineFunctionInfo: {}
60 ; CHECK-LABEL: name: mul_to_lshr_vector_out_of_range_shift
63 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
64 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
65 ; CHECK-NEXT: %bv:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
66 ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(<4 x s32>) = G_UMULH [[COPY]], %bv
67 ; CHECK-NEXT: $q0 = COPY [[UMULH]](<4 x s32>)
68 %0:_(<4 x s32>) = COPY $q0
69 %1:_(s32) = G_CONSTANT i32 1
70 %bv:_(<4 x s32>) = G_BUILD_VECTOR %1, %1, %1, %1
71 %2:_(<4 x s32>) = G_UMULH %0, %bv(<4 x s32>)
72 $q0 = COPY %2(<4 x s32>)
75 name: mul_to_lshr_out_of_range_shift
77 tracksRegLiveness: true
80 machineFunctionInfo: {}
84 ; CHECK-LABEL: name: mul_to_lshr_out_of_range_shift
87 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
88 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
89 ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s64) = G_UMULH [[COPY]], [[C]]
90 ; CHECK-NEXT: $x0 = COPY [[UMULH]](s64)
92 %1:_(s64) = G_CONSTANT i64 1
93 %2:_(s64) = G_UMULH %0, %1(s64)
97 name: mul_to_lshr_vector_nonuniform_const
99 tracksRegLiveness: true
102 machineFunctionInfo: {}
106 ; CHECK-LABEL: name: mul_to_lshr_vector_nonuniform_const
107 ; CHECK: liveins: $q0
109 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
110 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 28
111 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 27
112 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 26
113 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 29
114 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C3]](s32), [[C]](s32), [[C1]](s32), [[C2]](s32)
115 ; CHECK-NEXT: %mulh:_(<4 x s32>) = G_LSHR [[COPY]], [[BUILD_VECTOR]](<4 x s32>)
116 ; CHECK-NEXT: $q0 = COPY %mulh(<4 x s32>)
117 %0:_(<4 x s32>) = COPY $q0
118 %cst1:_(s32) = G_CONSTANT i32 8
119 %cst2:_(s32) = G_CONSTANT i32 16
120 %cst3:_(s32) = G_CONSTANT i32 32
121 %cst4:_(s32) = G_CONSTANT i32 64
122 %bv:_(<4 x s32>) = G_BUILD_VECTOR %cst1, %cst2, %cst3, %cst4
123 %mulh:_(<4 x s32>) = G_UMULH %0, %bv(<4 x s32>)
124 $q0 = COPY %mulh(<4 x s32>)
127 name: mul_to_lshr_vector_nonuniform_const_elt_is_one
129 tracksRegLiveness: true
132 machineFunctionInfo: {}
136 ; CHECK-LABEL: name: mul_to_lshr_vector_nonuniform_const_elt_is_one
137 ; CHECK: liveins: $q0
139 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
140 ; CHECK-NEXT: %cst1:_(s32) = G_CONSTANT i32 8
141 ; CHECK-NEXT: %cst2:_(s32) = G_CONSTANT i32 1
142 ; CHECK-NEXT: %cst3:_(s32) = G_CONSTANT i32 32
143 ; CHECK-NEXT: %cst4:_(s32) = G_CONSTANT i32 64
144 ; CHECK-NEXT: %bv:_(<4 x s32>) = G_BUILD_VECTOR %cst1(s32), %cst2(s32), %cst3(s32), %cst4(s32)
145 ; CHECK-NEXT: %mulh:_(<4 x s32>) = G_UMULH [[COPY]], %bv
146 ; CHECK-NEXT: $q0 = COPY %mulh(<4 x s32>)
147 %0:_(<4 x s32>) = COPY $q0
148 %cst1:_(s32) = G_CONSTANT i32 8
149 %cst2:_(s32) = G_CONSTANT i32 1
150 %cst3:_(s32) = G_CONSTANT i32 32
151 %cst4:_(s32) = G_CONSTANT i32 64
152 %bv:_(<4 x s32>) = G_BUILD_VECTOR %cst1, %cst2, %cst3, %cst4
153 %mulh:_(<4 x s32>) = G_UMULH %0, %bv(<4 x s32>)
154 $q0 = COPY %mulh(<4 x s32>)