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
3...
4---
5name:            mul_to_shl
6alignment:       4
7tracksRegLiveness: true
8frameInfo:
9  maxAlignment:    1
10machineFunctionInfo: {}
11body:             |
12  bb.0:
13    liveins: $x0
14    ; CHECK-LABEL: name: mul_to_shl
15    ; CHECK: liveins: $x0
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
21    %0:_(s64) = COPY $x0
22    %1:_(s64) = G_CONSTANT i64 4
23    %2:_(s64) = G_MUL %0, %1(s64)
24    $x0 = COPY %2(s64)
25    RET_ReallyLR implicit-def $x0
26...
27---
28name:            mul_to_shl_16
29alignment:       4
30tracksRegLiveness: true
31frameInfo:
32  maxAlignment:    1
33machineFunctionInfo: {}
34body:             |
35  bb.0:
36    liveins: $x0
37    ; CHECK-LABEL: name: mul_to_shl_16
38    ; CHECK: liveins: $x0
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
44    %0:_(s64) = COPY $x0
45    %1:_(s64) = G_CONSTANT i64 16
46    %2:_(s64) = G_MUL %0, %1(s64)
47    $x0 = COPY %2(s64)
48    RET_ReallyLR implicit-def $x0
49...
50---
51name:            mul_to_shl_vector_16
52alignment:       4
53tracksRegLiveness: true
54frameInfo:
55  maxAlignment:    1
56machineFunctionInfo: {}
57body:             |
58  bb.0:
59    liveins: $q0
60    ; Currently not implemented.
61    ; CHECK-LABEL: name: mul_to_shl_vector_16
62    ; CHECK: liveins: $q0
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
75...
76---
77name:            mul_to_shl_non_pow2
78alignment:       4
79tracksRegLiveness: true
80frameInfo:
81  maxAlignment:    1
82machineFunctionInfo: {}
83body:             |
84  bb.0:
85    liveins: $x0
86    ; CHECK-LABEL: name: mul_to_shl_non_pow2
87    ; CHECK: liveins: $x0
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
93    %0:_(s64) = COPY $x0
94    %1:_(s64) = G_CONSTANT i64 10
95    %2:_(s64) = G_MUL %0, %1(s64)
96    $x0 = COPY %2(s64)
97    RET_ReallyLR implicit-def $x0
98...
99