• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -o - -mtriple=aarch64-unknown-unknown -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs  %s | FileCheck %s
3---
4name:            test_combine_trunc_undef
5body:             |
6  bb.1:
7    ; CHECK-LABEL: name: test_combine_trunc_undef
8    ; CHECK: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
9    ; CHECK: $w0 = COPY [[DEF]](s32)
10    %0:_(s64) = G_IMPLICIT_DEF
11    %1:_(s32) = G_TRUNC %0(s64)
12    $w0 = COPY %1(s32)
13...
14---
15name:            test_combine_trunc_undef_vec
16body:             |
17  bb.1:
18    ; CHECK-LABEL: name: test_combine_trunc_undef_vec
19    ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s32>) = G_IMPLICIT_DEF
20    ; CHECK: $x0 = COPY [[DEF]](<2 x s32>)
21    %0:_(<2 x s64>) = G_IMPLICIT_DEF
22    %1:_(<2 x s32>) = G_TRUNC %0(<2 x s64>)
23    $x0 = COPY %1(<2 x s32>)
24...
25---
26name:            test_combine_trunc_anyext_s32_s16
27body:             |
28  bb.1:
29  liveins: $h0
30    ; CHECK-LABEL: name: test_combine_trunc_anyext_s32_s16
31    ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
32    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[COPY]](s16)
33    ; CHECK: $w0 = COPY [[ANYEXT]](s32)
34    %0:_(s16) = COPY $h0
35    %1:_(s64) = G_ANYEXT %0(s16)
36    %2:_(s32) = G_TRUNC %1(s64)
37    $w0 = COPY %2(s32)
38...
39---
40name:            test_combine_trunc_anyext_s32_s16_vec
41body:             |
42  bb.1:
43  liveins: $s0
44    ; CHECK-LABEL: name: test_combine_trunc_anyext_s32_s16_vec
45    ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s16>) = COPY $s0
46    ; CHECK: [[ANYEXT:%[0-9]+]]:_(<2 x s32>) = G_ANYEXT [[COPY]](<2 x s16>)
47    ; CHECK: $x0 = COPY [[ANYEXT]](<2 x s32>)
48    %0:_(<2 x s16>) = COPY $s0
49    %1:_(<2 x s64>) = G_ANYEXT %0(<2 x s16>)
50    %2:_(<2 x s32>) = G_TRUNC %1(<2 x s64>)
51    $x0 = COPY %2(<2 x s32>)
52...
53---
54name:            test_combine_trunc_sext_s32_s16
55body:             |
56  bb.1:
57  liveins: $h0
58    ; CHECK-LABEL: name: test_combine_trunc_sext_s32_s16
59    ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
60    ; CHECK: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[COPY]](s16)
61    ; CHECK: $w0 = COPY [[SEXT]](s32)
62    %0:_(s16) = COPY $h0
63    %1:_(s64) = G_SEXT %0(s16)
64    %2:_(s32) = G_TRUNC %1(s64)
65    $w0 = COPY %2(s32)
66...
67---
68name:            test_combine_trunc_zext_s32_s16
69body:             |
70  bb.1:
71  liveins: $h0
72    ; CHECK-LABEL: name: test_combine_trunc_zext_s32_s16
73    ; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $h0
74    ; CHECK: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[COPY]](s16)
75    ; CHECK: $w0 = COPY [[ZEXT]](s32)
76    %0:_(s16) = COPY $h0
77    %1:_(s64) = G_ZEXT %0(s16)
78    %2:_(s32) = G_TRUNC %1(s64)
79    $w0 = COPY %2(s32)
80...
81---
82name:            test_combine_trunc_anyext_s32_s32
83body:             |
84  bb.1:
85  liveins: $w0
86    ; CHECK-LABEL: name: test_combine_trunc_anyext_s32_s32
87    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
88    ; CHECK: $w0 = COPY [[COPY]](s32)
89    %0:_(s32) = COPY $w0
90    %1:_(s64) = G_ANYEXT %0(s32)
91    %2:_(s32) = G_TRUNC %1(s64)
92    $w0 = COPY %2(s32)
93...
94---
95name:            test_combine_trunc_anyext_s32_s64
96body:             |
97  bb.1:
98  liveins: $x0
99    ; CHECK-LABEL: name: test_combine_trunc_anyext_s32_s64
100    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
101    ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
102    ; CHECK: $w0 = COPY [[TRUNC]](s32)
103    %0:_(s64) = COPY $x0
104    %1:_(s128) = G_ANYEXT %0(s64)
105    %2:_(s32) = G_TRUNC %1(s128)
106    $w0 = COPY %2(s32)
107...
108---
109name:            test_combine_trunc_shl_s32_by_2
110body:             |
111  bb.1:
112  liveins: $w0
113    ; CHECK-LABEL: name: test_combine_trunc_shl_s32_by_2
114    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
115    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
116    ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
117    ; CHECK: [[SHL:%[0-9]+]]:_(s16) = G_SHL [[TRUNC]], [[C]](s32)
118    ; CHECK: $h0 = COPY [[SHL]](s16)
119    %0:_(s32) = COPY $w0
120    %1:_(s32) = G_CONSTANT i32 2
121    %2:_(s32) = G_SHL %0(s32), %1(s32)
122    %3:_(s16) = G_TRUNC %2(s32)
123    $h0 = COPY %3(s16)
124...
125---
126name:            test_combine_trunc_shl_s32_by_17
127body:             |
128  bb.1:
129  liveins: $w0
130    ; CHECK-LABEL: name: test_combine_trunc_shl_s32_by_17
131    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
132    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 17
133    ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
134    ; CHECK: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32)
135    ; CHECK: $h0 = COPY [[TRUNC]](s16)
136    %0:_(s32) = COPY $w0
137    %1:_(s32) = G_CONSTANT i32 17
138    %2:_(s32) = G_SHL %0(s32), %1(s32)
139    %3:_(s16) = G_TRUNC %2(s32)
140    $h0 = COPY %3(s16)
141...
142