1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
6 name: dont_combine_ptr_add
8 tracksRegLiveness: true
11 liveins: $x0, $x1, $x2
13 ; G_PTR_ADD can become a madd, so we don't want to perform the combine.
15 ; CHECK-LABEL: name: dont_combine_ptr_add
16 ; CHECK: liveins: $x0, $x1, $x2
17 ; CHECK: %reg0:_(s64) = COPY $x0
18 ; CHECK: %ptr:_(p0) = COPY $x2
19 ; CHECK: %cst:_(s64) = G_CONSTANT i64 6
20 ; CHECK: %mul:_(s64) = nsw G_MUL %reg0, %cst
21 ; CHECK: %ptr_add:_(p0) = G_PTR_ADD %ptr, %mul(s64)
22 ; CHECK: $x0 = COPY %ptr_add(p0)
23 ; CHECK: RET_ReallyLR implicit $x0
24 %reg0:_(s64) = COPY $x0
25 %reg1:_(s64) = COPY $x1
27 %cst:_(s64) = G_CONSTANT i64 6
28 %mul:_(s64) = nsw G_MUL %reg0, %cst
29 %ptr_add:_(p0) = G_PTR_ADD %ptr, %mul
30 $x0 = COPY %ptr_add(p0)
31 RET_ReallyLR implicit $x0