1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -march=aarch64 -run-pass=aarch64-prelegalizer-combiner -O0 -verify-machineinstrs %s -o - | FileCheck %s 3--- | 4 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" 5 target triple = "arm64-apple-darwin" 6 7 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1 immarg) #1 8 9 define void @test_small_memcpy(i32* nocapture %dst, i32* nocapture readonly %src) { 10 entry: 11 %0 = bitcast i32* %dst to i8* 12 %1 = bitcast i32* %src to i8* 13 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 %1, i64 32, i1 false) 14 ret void 15 } 16 17 define void @test_large_memcpy(i32* nocapture %dst, i32* nocapture readonly %src) { 18 entry: 19 %0 = bitcast i32* %dst to i8* 20 %1 = bitcast i32* %src to i8* 21 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 %1, i64 36, i1 false) 22 ret void 23 } 24 25 attributes #1 = { argmemonly nounwind } 26 27... 28--- 29name: test_small_memcpy 30alignment: 4 31tracksRegLiveness: true 32registers: 33 - { id: 0, class: _ } 34 - { id: 1, class: _ } 35 - { id: 2, class: _ } 36machineFunctionInfo: {} 37body: | 38 bb.1.entry: 39 liveins: $x0, $x1 40 41 ; CHECK-LABEL: name: test_small_memcpy 42 ; CHECK: liveins: $x0, $x1 43 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 44 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1 45 ; CHECK: [[LOAD:%[0-9]+]]:_(s128) = G_LOAD [[COPY1]](p0) :: (load 16 from %ir.1, align 4) 46 ; CHECK: G_STORE [[LOAD]](s128), [[COPY]](p0) :: (store 16 into %ir.0, align 4) 47 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16 48 ; CHECK: [[GEP:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C]](s64) 49 ; CHECK: [[LOAD1:%[0-9]+]]:_(s128) = G_LOAD [[GEP]](p0) :: (load 16 from %ir.1 + 16, align 4) 50 ; CHECK: [[GEP1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s64) 51 ; CHECK: G_STORE [[LOAD1]](s128), [[GEP1]](p0) :: (store 16 into %ir.0 + 16, align 4) 52 ; CHECK: RET_ReallyLR 53 %0:_(p0) = COPY $x0 54 %1:_(p0) = COPY $x1 55 %2:_(s64) = G_CONSTANT i64 32 56 G_MEMCPY %0(p0), %1(p0), %2(s64), 1 :: (store 1 into %ir.0, align 4), (load 1 from %ir.1, align 4) 57 RET_ReallyLR 58 59... 60--- 61name: test_large_memcpy 62alignment: 4 63tracksRegLiveness: true 64registers: 65 - { id: 0, class: _ } 66 - { id: 1, class: _ } 67 - { id: 2, class: _ } 68machineFunctionInfo: {} 69body: | 70 bb.1.entry: 71 liveins: $x0, $x1 72 73 ; CHECK-LABEL: name: test_large_memcpy 74 ; CHECK: liveins: $x0, $x1 75 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 76 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1 77 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 36 78 ; CHECK: G_MEMCPY [[COPY]](p0), [[COPY1]](p0), [[C]](s64), 1 :: (store 1 into %ir.0, align 4), (load 1 from %ir.1, align 4) 79 ; CHECK: RET_ReallyLR 80 %0:_(p0) = COPY $x0 81 %1:_(p0) = COPY $x1 82 %2:_(s64) = G_CONSTANT i64 36 83 G_MEMCPY %0(p0), %1(p0), %2(s64), 1 :: (store 1 into %ir.0, align 4), (load 1 from %ir.1, align 4) 84 RET_ReallyLR 85 86... 87