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
5 name: test_combine_sext_trunc_of_sextload
7 tracksRegLiveness: true
11 ; CHECK-LABEL: name: test_combine_sext_trunc_of_sextload
13 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
14 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
15 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SEXTLOAD]](s64)
16 ; CHECK: $w0 = COPY [[TRUNC]](s32)
18 %1:_(s64) = G_SEXTLOAD %0:_(p0) :: (load (s16))
19 %2:_(s32) = G_TRUNC %1:_(s64)
20 %3:_(s32) = G_SEXT_INREG %2:_(s32), 16
24 name: test_combine_sext_of_sextload
26 tracksRegLiveness: true
30 ; CHECK-LABEL: name: test_combine_sext_of_sextload
32 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
33 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
34 ; CHECK: $w0 = COPY [[SEXTLOAD]](s32)
36 %1:_(s32) = G_SEXTLOAD %0:_(p0) :: (load (s16))
37 %2:_(s32) = COPY %1:_(s32)
38 %3:_(s32) = G_SEXT_INREG %2:_(s32), 16
42 name: test_combine_sext_of_sextload_not_matching
44 tracksRegLiveness: true
48 ; Here we're trying to extend from a smaller value than was extended in the load.
49 ; CHECK-LABEL: name: test_combine_sext_of_sextload_not_matching
51 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
52 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load (s16))
53 ; CHECK: $w0 = COPY [[SEXTLOAD]](s32)
55 %1:_(s32) = G_SEXTLOAD %0:_(p0) :: (load (s16))
56 %2:_(s32) = COPY %1:_(s32)
57 %3:_(s32) = G_SEXT_INREG %2:_(s32), 24