1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=aarch64-prelegalizer-combiner -O0 -verify-machineinstrs %s -o - | FileCheck %s
4 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
5 target triple = "arm64-apple-darwin"
7 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1 immarg) #1
9 define void @test_small_memcpy(i32* nocapture %dst, i32* nocapture readonly %src) {
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)
17 define void @test_large_memcpy(i32* nocapture %dst, i32* nocapture readonly %src) {
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)
25 attributes #1 = { argmemonly nounwind }
29 name: test_small_memcpy
31 tracksRegLiveness: true
36 machineFunctionInfo: {}
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 (s128) from %ir.1, align 4)
46 ; CHECK: G_STORE [[LOAD]](s128), [[COPY]](p0) :: (store (s128) into %ir.0, align 4)
47 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
48 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C]](s64)
49 ; CHECK: [[LOAD1:%[0-9]+]]:_(s128) = G_LOAD [[PTR_ADD]](p0) :: (load (s128) from %ir.1 + 16, align 4)
50 ; CHECK: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s64)
51 ; CHECK: G_STORE [[LOAD1]](s128), [[PTR_ADD1]](p0) :: (store (s128) into %ir.0 + 16, align 4)
55 %2:_(s64) = G_CONSTANT i64 32
56 G_MEMCPY %0(p0), %1(p0), %2(s64), 1 :: (store (s8) into %ir.0, align 4), (load (s8) from %ir.1, align 4)
61 name: test_large_memcpy
63 tracksRegLiveness: true
68 machineFunctionInfo: {}
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 (s8) into %ir.0, align 4), (load (s8) from %ir.1, align 4)
82 %2:_(s64) = G_CONSTANT i64 36
83 G_MEMCPY %0(p0), %1(p0), %2(s64), 1 :: (store (s8) into %ir.0, align 4), (load (s8) from %ir.1, align 4)