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 --aarch64postlegalizercombiner-only-enable-rule="ptr_add_immed_chain" %s -o - -verify-machineinstrs | FileCheck %s
5 # Check that we fold two adds of constant offsets with G_PTR_ADD into a single G_PTR_ADD.
8 tracksRegLiveness: true
14 ; CHECK-LABEL: name: ptradd_chain
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
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
27 RET_ReallyLR implicit $x0