1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
llvm-mirror/test/CodeGen/X86/2004-02-12-Memcpy.ll
Evan Cheng ef2509b3ba Fix a number of byval / memcpy / memset related codegen issues.
1. x86-64 byval alignment should be max of 8 and alignment of type. Previously the code was not doing what the commit message was saying.
2. Do not use byte repeat move and store operations. These are slow.

llvm-svn: 55139
2008-08-21 21:00:15 +00:00

26 lines
832 B
LLVM

; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 1
@A = global [32 x i32] zeroinitializer
@B = global [32 x i32] zeroinitializer
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
define void @main() nounwind {
; dword copy
call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*),
i8* bitcast ([32 x i32]* @B to i8*),
i32 128, i32 4 )
; word copy
call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
i8* bitcast ([32 x i32]* @B to i8*),
i32 128, i32 2 )
; byte copy
call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
i8* bitcast ([32 x i32]* @B to i8*),
i32 128, i32 1 )
ret void
}