1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
3 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
6 ; Variable memcpy's should lower to calls.
7 define i8* @test1(i8* %a, i8* %b, i64 %n) nounwind {
9 tail call void @llvm.memcpy.p0i8.p0i8.i64( i8* %a, i8* %b, i64 %n, i32 1, i1 0 )
16 ; Variable memcpy's should lower to calls.
17 define i8* @test2(i64* %a, i64* %b, i64 %n) nounwind {
19 %tmp14 = bitcast i64* %a to i8*
20 %tmp25 = bitcast i64* %b to i8*
21 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp14, i8* %tmp25, i64 %n, i32 8, i1 0 )
28 ; Large constant memcpy's should lower to a call when optimizing for size.
30 define void @test3(i8* nocapture %A, i8* nocapture %B) nounwind optsize noredzone {
32 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i32 1, i1 false)
38 ; Large constant memcpy's should be inlined when not optimizing for size.
39 define void @test4(i8* nocapture %A, i8* nocapture %B) nounwind noredzone {
41 tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i32 1, i1 false)