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_shl
16 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
17 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
18 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
19 ; CHECK: $x0 = COPY [[SHL]](s64)
20 ; CHECK: RET_ReallyLR implicit-def $x0
22 %1:_(s64) = G_CONSTANT i64 4
23 %2:_(s64) = G_MUL %0, %1(s64)
25 RET_ReallyLR implicit-def $x0
30 tracksRegLiveness: true
33 machineFunctionInfo: {}
37 ; CHECK-LABEL: name: mul_to_shl_16
39 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
40 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4
41 ; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
42 ; CHECK: $x0 = COPY [[SHL]](s64)
43 ; CHECK: RET_ReallyLR implicit-def $x0
45 %1:_(s64) = G_CONSTANT i64 16
46 %2:_(s64) = G_MUL %0, %1(s64)
48 RET_ReallyLR implicit-def $x0
51 name: mul_to_shl_vector_16
53 tracksRegLiveness: true
56 machineFunctionInfo: {}
60 ; Currently not implemented.
61 ; CHECK-LABEL: name: mul_to_shl_vector_16
63 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
64 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
65 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32), [[C]](s32), [[C]](s32)
66 ; CHECK: [[MUL:%[0-9]+]]:_(<4 x s32>) = G_MUL [[COPY]], [[BUILD_VECTOR]]
67 ; CHECK: $q0 = COPY [[MUL]](<4 x s32>)
68 ; CHECK: RET_ReallyLR implicit-def $q0
69 %0:_(<4 x s32>) = COPY $q0
70 %1:_(s32) = G_CONSTANT i32 16
71 %2:_(<4 x s32>) = G_BUILD_VECTOR %1(s32), %1(s32), %1(s32), %1(s32)
72 %3:_(<4 x s32>) = G_MUL %0, %2(<4 x s32>)
73 $q0 = COPY %3(<4 x s32>)
74 RET_ReallyLR implicit-def $q0
77 name: mul_to_shl_non_pow2
79 tracksRegLiveness: true
82 machineFunctionInfo: {}
86 ; CHECK-LABEL: name: mul_to_shl_non_pow2
88 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
89 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 10
90 ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[C]]
91 ; CHECK: $x0 = COPY [[MUL]](s64)
92 ; CHECK: RET_ReallyLR implicit-def $x0
94 %1:_(s64) = G_CONSTANT i64 10
95 %2:_(s64) = G_MUL %0, %1(s64)
97 RET_ReallyLR implicit-def $x0