File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
test/CodeGen/AArch64/GlobalISel Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,7 @@ def AArch64PostLegalizerCombinerHelper
212
212
form_bitfield_extract, rotate_out_of_range,
213
213
icmp_to_true_false_known_bits, merge_unmerge,
214
214
select_combines, fold_merge_to_zext,
215
- constant_fold, identity_combines]> {
215
+ constant_fold, identity_combines,
216
+ ptr_add_immed_chain]> {
216
217
let DisableRuleOption = "aarch64postlegalizercombiner-disable-rule";
217
218
}
Original file line number Diff line number Diff line change
1
+ # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2
+ # RUN: llc -mtriple aarch64-apple-ios -run-pass=aarch64-postlegalizer-combiner --aarch64postlegalizercombinerhelper-only-enable-rule="ptr_add_immed_chain" %s -o - -verify-machineinstrs | FileCheck %s
3
+ # REQUIRES: asserts
4
+
5
+ # Check that we fold two adds of constant offsets with G_PTR_ADD into a single G_PTR_ADD.
6
+ ---
7
+ name : ptradd_chain
8
+ tracksRegLiveness : true
9
+ legalized : true
10
+ body : |
11
+ bb.1:
12
+ liveins: $x0
13
+
14
+ ; CHECK-LABEL: name: ptradd_chain
15
+ ; CHECK: liveins: $x0
16
+ ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
17
+ ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
18
+ ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s64)
19
+ ; CHECK: $x0 = COPY [[PTR_ADD]](p0)
20
+ ; CHECK: RET_ReallyLR implicit $x0
21
+ %0:_(p0) = COPY $x0
22
+ %1:_(s64) = G_CONSTANT i64 4
23
+ %2:_(s64) = G_CONSTANT i64 12
24
+ %3:_(p0) = G_PTR_ADD %0(p0), %1
25
+ %4:_(p0) = G_PTR_ADD %3(p0), %2
26
+ $x0 = COPY %4(p0)
27
+ RET_ReallyLR implicit $x0
28
+ ...
You can’t perform that action at this time.
0 commit comments