1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
3 # RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner --aarch64prelegalizercombiner-only-enable-rule="and_or_disjoint_mask" -global-isel -verify-machineinstrs %s -o - | FileCheck %s
9 tracksRegLiveness: true
10 machineFunctionInfo: {}
14 ; CHECK-LABEL: name: disjoint_masks
17 ; CHECK-NEXT: %x:_(s32) = COPY $w0
18 ; CHECK-NEXT: %two:_(s32) = G_CONSTANT i32 2
19 ; CHECK-NEXT: %and:_(s32) = G_AND %x, %two
20 ; CHECK-NEXT: $w0 = COPY %and(s32)
21 ; CHECK-NEXT: RET_ReallyLR implicit $w0
23 %one:_(s32) = G_CONSTANT i32 1
24 %two:_(s32) = G_CONSTANT i32 2
25 %or:_(s32) = G_OR %x, %one
26 %and:_(s32) = G_AND %or, %two
28 RET_ReallyLR implicit $w0
31 name: disjoint_masks_rev
32 tracksRegLiveness: true
33 machineFunctionInfo: {}
37 ; CHECK-LABEL: name: disjoint_masks_rev
40 ; CHECK-NEXT: %x:_(s32) = COPY $w0
41 ; CHECK-NEXT: %two:_(s32) = G_CONSTANT i32 2
42 ; CHECK-NEXT: %and:_(s32) = G_AND %x, %two
43 ; CHECK-NEXT: $w0 = COPY %and(s32)
44 ; CHECK-NEXT: RET_ReallyLR implicit $w0
46 %one:_(s32) = G_CONSTANT i32 1
47 %two:_(s32) = G_CONSTANT i32 2
48 %or:_(s32) = G_OR %x, %one
49 %and:_(s32) = G_AND %two, %or
51 RET_ReallyLR implicit $w0
54 name: intersecting_masks
55 tracksRegLiveness: true
56 machineFunctionInfo: {}
60 ; CHECK-LABEL: name: intersecting_masks
63 ; CHECK-NEXT: %x:_(s32) = COPY $w0
64 ; CHECK-NEXT: %one:_(s32) = G_CONSTANT i32 3
65 ; CHECK-NEXT: %two:_(s32) = G_CONSTANT i32 2
66 ; CHECK-NEXT: %or:_(s32) = G_OR %x, %one
67 ; CHECK-NEXT: %and:_(s32) = G_AND %or, %two
68 ; CHECK-NEXT: $w0 = COPY %and(s32)
69 ; CHECK-NEXT: RET_ReallyLR implicit $w0
71 %one:_(s32) = G_CONSTANT i32 3
72 %two:_(s32) = G_CONSTANT i32 2
73 %or:_(s32) = G_OR %x, %one
74 %and:_(s32) = G_AND %or, %two
76 RET_ReallyLR implicit $w0
79 name: intersecting_masks_rev
80 tracksRegLiveness: true
81 machineFunctionInfo: {}
85 ; CHECK-LABEL: name: intersecting_masks_rev
88 ; CHECK-NEXT: %x:_(s32) = COPY $w0
89 ; CHECK-NEXT: %one:_(s32) = G_CONSTANT i32 3
90 ; CHECK-NEXT: %two:_(s32) = G_CONSTANT i32 2
91 ; CHECK-NEXT: %or:_(s32) = G_OR %x, %one
92 ; CHECK-NEXT: %and:_(s32) = G_AND %two, %or
93 ; CHECK-NEXT: $w0 = COPY %and(s32)
94 ; CHECK-NEXT: RET_ReallyLR implicit $w0
96 %one:_(s32) = G_CONSTANT i32 3
97 %two:_(s32) = G_CONSTANT i32 2
98 %or:_(s32) = G_OR %x, %one
99 %and:_(s32) = G_AND %two, %or
101 RET_ReallyLR implicit $w0
104 name: disjoint_masks_v
105 tracksRegLiveness: true
106 machineFunctionInfo: {}
110 ; CHECK-LABEL: name: disjoint_masks_v
111 ; CHECK: liveins: $x0
113 ; CHECK-NEXT: %x:_(<2 x s32>) = COPY $x0
114 ; CHECK-NEXT: %one:_(s32) = G_CONSTANT i32 1
115 ; CHECK-NEXT: %one_v:_(<2 x s32>) = G_DUP %one(s32)
116 ; CHECK-NEXT: %two:_(s32) = G_CONSTANT i32 2
117 ; CHECK-NEXT: %two_v:_(<2 x s32>) = G_DUP %two(s32)
118 ; CHECK-NEXT: %or:_(<2 x s32>) = G_OR %x, %one_v
119 ; CHECK-NEXT: %and:_(<2 x s32>) = G_AND %or, %two_v
120 ; CHECK-NEXT: $x0 = COPY %and(<2 x s32>)
121 ; CHECK-NEXT: RET_ReallyLR implicit $x0
122 %x:_(<2 x s32>) = COPY $x0
123 %one:_(s32) = G_CONSTANT i32 1
124 %one_v:_(<2 x s32>) = G_DUP %one
125 %two:_(s32) = G_CONSTANT i32 2
126 %two_v:_(<2 x s32>) = G_DUP %two
127 %or:_(<2 x s32>) = G_OR %x, %one_v
128 %and:_(<2 x s32>) = G_AND %or, %two_v
129 $x0 = COPY %and(<2 x s32>)
130 RET_ReallyLR implicit $x0