summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/memcpy.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-07-30 21:41:50 +0000
committerSanjay Patel <spatel@rotateright.com>2015-07-30 21:41:50 +0000
commit1166f2ff9f30a84fea630888b297bf58c3dba7e9 (patch)
tree80e04d68cbf5db5d6a91f2c552dc5f0fff249ca8 /llvm/test/CodeGen/X86/memcpy.ll
parent0deb694d943f914657437229f077b64aacf4fec7 (diff)
downloadbcm5719-llvm-1166f2ff9f30a84fea630888b297bf58c3dba7e9.tar.gz
bcm5719-llvm-1166f2ff9f30a84fea630888b297bf58c3dba7e9.zip
fix memcpy/memset/memmove lowering when optimizing for size
Fixing MinSize attribute handling was discussed in D11363. This is a prerequisite patch to doing that. The handling of OptSize when lowering mem* functions was broken on Darwin because it wants to ignore -Os for these cases, but the existing logic also made it ignore -Oz (MinSize). The Linux change demonstrates a widespread problem. The backend doesn't usually recognize the MinSize attribute by itself; it assumes that if the MinSize attribute exists, then the OptSize attribute must also exist. Fixing this more generally will be a follow-on patch or two. Differential Revision: http://reviews.llvm.org/D11568 llvm-svn: 243693
Diffstat (limited to 'llvm/test/CodeGen/X86/memcpy.ll')
-rw-r--r--llvm/test/CodeGen/X86/memcpy.ll53
1 files changed, 3 insertions, 50 deletions
diff --git a/llvm/test/CodeGen/X86/memcpy.ll b/llvm/test/CodeGen/X86/memcpy.ll
index 78d250930c2..00669443d6d 100644
--- a/llvm/test/CodeGen/X86/memcpy.ll
+++ b/llvm/test/CodeGen/X86/memcpy.ll
@@ -59,48 +59,16 @@ entry:
; DARWIN: movq
}
-; FIXME: Both Linux and Darwin should lower to a memcpy call; minsize is on.
define void @test3_minsize(i8* nocapture %A, i8* nocapture %B) nounwind minsize noredzone {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i32 1, i1 false)
ret void
; LINUX-LABEL: test3_minsize:
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
-; LINUX: movq
+; LINUX: memcpy
; DARWIN-LABEL: test3_minsize:
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
+; DARWIN: memcpy
}
-; FIXME: Darwin should lower to a memcpy call; minsize is on.
define void @test3_minsize_optsize(i8* nocapture %A, i8* nocapture %B) nounwind optsize minsize noredzone {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i32 1, i1 false)
ret void
@@ -108,22 +76,7 @@ define void @test3_minsize_optsize(i8* nocapture %A, i8* nocapture %B) nounwind
; LINUX: memcpy
; DARWIN-LABEL: test3_minsize_optsize:
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
-; DARWIN: movq
+; DARWIN: memcpy
}
; Large constant memcpy's should be inlined when not optimizing for size.
OpenPOWER on IntegriCloud