• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -run-pass=legalizer -global-isel-abort=1 %s -o - | FileCheck %s
3
4--- |
5  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6  target triple = "aarch64--"
7  define void @test_combines_2() { ret void }
8  define void @test_combines_3() { ret void }
9  define void @test_combines_4() { ret void }
10  define void @test_combines_5() { ret void }
11  define void @test_combines_6() { ret void }
12...
13
14---
15name:            test_combines_2
16body: |
17  bb.0:
18    liveins: $w0
19
20    ; Here the types don't match.
21    ; CHECK-LABEL: name: test_combines_2
22    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
23    ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
24    ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[ADD]](s32)
25    ; CHECK: [[EXTRACT:%[0-9]+]]:_(s1) = G_EXTRACT [[COPY]](s32), 0
26    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[EXTRACT]](s1)
27    ; CHECK: $w0 = COPY [[ANYEXT]](s32)
28    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[MV]](s64)
29    ; CHECK: $x0 = COPY [[COPY1]](s64)
30    %0:_(s32) = COPY $w0
31
32    %1:_(s32) = G_ADD %0, %0
33    %2:_(s64) = G_MERGE_VALUES %0, %1
34    %3:_(s1) = G_EXTRACT %2, 0
35    %5:_(s32) = G_ANYEXT %3
36    $w0 = COPY %5
37    %4:_(s64) = COPY %2
38    $x0 = COPY %4
39...
40
41---
42name:            test_combines_3
43body: |
44  bb.0:
45    liveins: $w0
46
47    ; CHECK-LABEL: name: test_combines_3
48    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
49    ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
50    ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ADD]]
51    ; CHECK: $w0 = COPY [[ADD1]](s32)
52    %0:_(s32) = COPY $w0
53
54    %1:_(s32) = G_ADD %0, %0
55    %2:_(s64) = G_MERGE_VALUES %0, %1
56    %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2
57    %5:_(s32) = G_ADD %3, %4
58    $w0 = COPY %5
59...
60
61---
62name:            test_combines_4
63body: |
64  bb.0:
65    liveins: $x0
66
67    ; CHECK-LABEL: name: test_combines_4
68    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
69    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
70    ; CHECK: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY1]], [[COPY1]]
71    ; CHECK: $x0 = COPY [[ADD]](s64)
72    %0:_(s64) = COPY $x0
73
74    %1:_(s128) = G_MERGE_VALUES %0, %0
75    %2:_(s64) = G_EXTRACT %1, 0
76    %3:_(s64) = G_ADD %2, %2
77    $x0 = COPY %3
78...
79
80---
81name:            test_combines_5
82body: |
83  bb.0:
84    liveins: $w0
85
86    ; CHECK-LABEL: name: test_combines_5
87    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
88    ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
89    ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ADD]]
90    ; CHECK: $w0 = COPY [[ADD1]](s32)
91    %0:_(s32) = COPY $w0
92
93    %1:_(s32) = G_ADD %0, %0
94    %2:_(s64) = G_MERGE_VALUES %0, %1
95    %6:_(s64) = COPY %2
96    %7:_(s64) = COPY %6
97    %8:_(s64) = COPY %7
98    %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %8
99    %5:_(s32) = G_ADD %3, %4
100    $w0 = COPY %5
101...
102
103---
104name:            test_combines_6
105body: |
106  bb.0:
107    liveins: $w0
108
109    ; CHECK-LABEL: name: test_combines_6
110    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
111    ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
112    ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[ADD]](s32)
113    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[MV]](s64)
114    ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY [[COPY1]](s64)
115    ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ADD]]
116    ; CHECK: $w0 = COPY [[ADD1]](s32)
117    ; CHECK: $x0 = COPY [[COPY2]](s64)
118    %0:_(s32) = COPY $w0
119
120    %1:_(s32) = G_ADD %0, %0
121    %2:_(s64) = G_MERGE_VALUES %0, %1
122    %6:_(s64) = COPY %2
123    %7:_(s64) = COPY %6
124    %8:_(s64) = COPY %7
125    %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %8
126    %5:_(s32) = G_ADD %3, %4
127    $w0 = COPY %5
128    $x0 = COPY %7
129...
130