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
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 }
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: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
26 ; CHECK: $w0 = COPY [[COPY1]](s32)
27 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY [[MV]](s64)
28 ; CHECK: $x0 = COPY [[COPY2]](s64)
31 %1:_(s32) = G_ADD %0, %0
32 %2:_(s64) = G_MERGE_VALUES %0, %1
33 %3:_(s1) = G_EXTRACT %2, 0
34 %5:_(s32) = G_ANYEXT %3
46 ; CHECK-LABEL: name: test_combines_3
47 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
48 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
49 ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ADD]]
50 ; CHECK: $w0 = COPY [[ADD1]](s32)
53 %1:_(s32) = G_ADD %0, %0
54 %2:_(s64) = G_MERGE_VALUES %0, %1
55 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %2
56 %5:_(s32) = G_ADD %3, %4
66 ; CHECK-LABEL: name: test_combines_4
67 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
68 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
69 ; CHECK: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY1]], [[COPY1]]
70 ; CHECK: $x0 = COPY [[ADD]](s64)
73 %1:_(s128) = G_MERGE_VALUES %0, %0
74 %2:_(s64) = G_EXTRACT %1, 0
75 %3:_(s64) = G_ADD %2, %2
85 ; CHECK-LABEL: name: test_combines_5
86 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
87 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
88 ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ADD]]
89 ; CHECK: $w0 = COPY [[ADD1]](s32)
92 %1:_(s32) = G_ADD %0, %0
93 %2:_(s64) = G_MERGE_VALUES %0, %1
97 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %8
98 %5:_(s32) = G_ADD %3, %4
103 name: test_combines_6
108 ; CHECK-LABEL: name: test_combines_6
109 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
110 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY]]
111 ; CHECK: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[ADD]](s32)
112 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[MV]](s64)
113 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY [[COPY1]](s64)
114 ; CHECK: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[ADD]]
115 ; CHECK: $w0 = COPY [[ADD1]](s32)
116 ; CHECK: $x0 = COPY [[COPY2]](s64)
119 %1:_(s32) = G_ADD %0, %0
120 %2:_(s64) = G_MERGE_VALUES %0, %1
124 %3:_(s32), %4:_(s32) = G_UNMERGE_VALUES %8
125 %5:_(s32) = G_ADD %3, %4