1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s
3 # RUN: llc -debugify-and-strip-all-safe -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s
6 name: fconstant_to_constant_s32
8 tracksRegLiveness: true
11 machineFunctionInfo: {}
15 ; Only feeding into stores here. Also, the value can't be materialized using
16 ; fmov, so it's strictly better to use a mov.
17 ; CHECK-LABEL: name: fconstant_to_constant_s32
19 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
20 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1028443341
21 ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 524
22 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C1]](s64)
23 ; CHECK: G_STORE [[C]](s32), [[PTR_ADD]](p0) :: (store (s32))
26 %3:_(s32) = G_FCONSTANT float 0x3FA99999A0000000
27 %1:_(s64) = G_CONSTANT i64 524
28 %2:_(p0) = G_PTR_ADD %0, %1(s64)
29 G_STORE %3(s32), %2(p0) :: (store (s32))
33 name: fconstant_to_constant_s64
35 tracksRegLiveness: true
38 machineFunctionInfo: {}
42 ; CHECK-LABEL: name: fconstant_to_constant_s64
44 ; CHECK: %ptr:_(p0) = COPY $x0
45 ; CHECK: %c:_(s64) = G_CONSTANT i64 0
46 ; CHECK: G_STORE %c(s64), %ptr(p0) :: (store (s64))
49 %c:_(s64) = G_FCONSTANT double 0.0
50 G_STORE %c(s64), %ptr(p0) :: (store (s64))
54 name: no_store_means_no_combine
56 tracksRegLiveness: true
59 machineFunctionInfo: {}
63 ; When we aren't feeding into a store, the combine shouldn't happen.
64 ; CHECK-LABEL: name: no_store_means_no_combine
65 ; CHECK: liveins: $x0, $x1
66 ; CHECK: %v:_(s64) = COPY $x0
67 ; CHECK: %c:_(s64) = G_FCONSTANT double 0.000000e+00
68 ; CHECK: %add:_(s64) = G_FADD %v, %c
69 ; CHECK: RET_ReallyLR implicit %add(s64)
71 %c:_(s64) = G_FCONSTANT double 0.0
72 %add:_(s64) = G_FADD %v, %c
73 RET_ReallyLR implicit %add