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 3--- 4name: test_combine_sext_trunc_of_sextload 5legalized: true 6tracksRegLiveness: true 7body: | 8 bb.0.entry: 9 liveins: $x0 10 ; CHECK-LABEL: name: test_combine_sext_trunc_of_sextload 11 ; CHECK: liveins: $x0 12 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 13 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s64) = G_SEXTLOAD [[COPY]](p0) :: (load 2) 14 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SEXTLOAD]](s64) 15 ; CHECK: $w0 = COPY [[TRUNC]](s32) 16 %0:_(p0) = COPY $x0 17 %1:_(s64) = G_SEXTLOAD %0:_(p0) :: (load 2) 18 %2:_(s32) = G_TRUNC %1:_(s64) 19 %3:_(s32) = G_SEXT_INREG %2:_(s32), 16 20 $w0 = COPY %3(s32) 21... 22--- 23name: test_combine_sext_of_sextload 24legalized: true 25tracksRegLiveness: true 26body: | 27 bb.0.entry: 28 liveins: $x0 29 ; CHECK-LABEL: name: test_combine_sext_of_sextload 30 ; CHECK: liveins: $x0 31 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 32 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 2) 33 ; CHECK: $w0 = COPY [[SEXTLOAD]](s32) 34 %0:_(p0) = COPY $x0 35 %1:_(s32) = G_SEXTLOAD %0:_(p0) :: (load 2) 36 %2:_(s32) = COPY %1:_(s32) 37 %3:_(s32) = G_SEXT_INREG %2:_(s32), 16 38 $w0 = COPY %3(s32) 39... 40--- 41name: test_combine_sext_of_sextload_not_matching 42legalized: true 43tracksRegLiveness: true 44body: | 45 bb.0.entry: 46 liveins: $x0 47 ; Here we're trying to extend from a smaller value than was extended in the load. 48 ; CHECK-LABEL: name: test_combine_sext_of_sextload_not_matching 49 ; CHECK: liveins: $x0 50 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 51 ; CHECK: [[SEXTLOAD:%[0-9]+]]:_(s32) = G_SEXTLOAD [[COPY]](p0) :: (load 2) 52 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[SEXTLOAD]], 24 53 ; CHECK: $w0 = COPY [[SEXT_INREG]](s32) 54 %0:_(p0) = COPY $x0 55 %1:_(s32) = G_SEXTLOAD %0:_(p0) :: (load 2) 56 %2:_(s32) = COPY %1:_(s32) 57 %3:_(s32) = G_SEXT_INREG %2:_(s32), 24 58 $w0 = COPY %3(s32) 59... 60