1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-none-linux-gnu -mcpu=neoverse-n2 -run-pass machine-combiner \
3 # RUN: -verify-machineinstrs -o - %s | FileCheck %s
5 # Most machine-combiner reassociation tests are put in machine-combiner.ll.
6 # However, we cannot test reassociation of SVE EORs in machine-combiner.ll
7 # because isel combines two EORs to one EOR3. So SVE EOR-specific test is put
12 name: reassociate_xors_sve_1
14 - { id: 0, class: zpr, preferred-register: '' }
15 - { id: 1, class: zpr, preferred-register: '' }
16 - { id: 2, class: zpr, preferred-register: '' }
17 - { id: 3, class: zpr, preferred-register: '' }
18 - { id: 4, class: zpr, preferred-register: '' }
19 - { id: 5, class: zpr, preferred-register: '' }
20 - { id: 6, class: zpr, preferred-register: '' }
23 liveins: $z0, $z1, $z2, $z3
25 ; CHECK-LABEL: name: reassociate_xors_sve_1
26 ; CHECK: liveins: $z0, $z1, $z2, $z3
28 ; CHECK-NEXT: [[COPY:%[0-9]+]]:zpr = COPY $z3
29 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:zpr = COPY $z2
30 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:zpr = COPY $z1
31 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:zpr = COPY $z0
32 ; CHECK-NEXT: [[EOR_ZZZ:%[0-9]+]]:zpr = EOR_ZZZ [[COPY3]], [[COPY2]]
33 ; CHECK-NEXT: [[EOR_ZZZ1:%[0-9]+]]:zpr = EOR_ZZZ [[COPY1]], [[COPY]]
34 ; CHECK-NEXT: [[EOR_ZZZ2:%[0-9]+]]:zpr = EOR_ZZZ killed [[EOR_ZZZ]], killed [[EOR_ZZZ1]]
35 ; CHECK-NEXT: $z0 = COPY [[EOR_ZZZ2]]
36 ; CHECK-NEXT: RET_ReallyLR implicit $z0
41 %4:zpr = EOR_ZZZ %0, %1
42 %5:zpr = EOR_ZZZ killed %4, %2
43 %6:zpr = EOR_ZZZ killed %5, %3
45 RET_ReallyLR implicit $z0
50 name: reassociate_xors_sve_2
52 - { id: 0, class: zpr, preferred-register: '' }
53 - { id: 1, class: zpr, preferred-register: '' }
54 - { id: 2, class: zpr, preferred-register: '' }
55 - { id: 3, class: zpr, preferred-register: '' }
56 - { id: 4, class: zpr, preferred-register: '' }
57 - { id: 5, class: zpr, preferred-register: '' }
58 - { id: 6, class: zpr, preferred-register: '' }
61 liveins: $z0, $z1, $z2, $z3
63 ; CHECK-LABEL: name: reassociate_xors_sve_2
64 ; CHECK: liveins: $z0, $z1, $z2, $z3
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:zpr = COPY $z3
67 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:zpr = COPY $z2
68 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:zpr = COPY $z1
69 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:zpr = COPY $z0
70 ; CHECK-NEXT: [[AND_ZZZ:%[0-9]+]]:zpr = AND_ZZZ [[COPY3]], [[COPY2]]
71 ; CHECK-NEXT: [[EOR_ZZZ:%[0-9]+]]:zpr = EOR_ZZZ [[COPY1]], [[COPY]]
72 ; CHECK-NEXT: [[EOR_ZZZ1:%[0-9]+]]:zpr = EOR_ZZZ killed [[AND_ZZZ]], killed [[EOR_ZZZ]]
73 ; CHECK-NEXT: $z0 = COPY [[EOR_ZZZ1]]
74 ; CHECK-NEXT: RET_ReallyLR implicit $z0
79 %4:zpr = AND_ZZZ %0, %1
80 %5:zpr = EOR_ZZZ killed %4, %2
81 %6:zpr = EOR_ZZZ killed %5, %3
83 RET_ReallyLR implicit $z0