diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-31 17:30:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-31 17:30:14 +0000 |
commit | 6c41ad8c9a93668c481436fc4a5e47e6f14776e7 (patch) | |
tree | 6ea0fee4e685e22e424ddd1c82eba5fb16a3bbb5 /test | |
parent | 0ece9a12acd166b937fe615a24ee2135d92d66c1 (diff) | |
download | llvm-6c41ad8c9a93668c481436fc4a5e47e6f14776e7.tar.gz llvm-6c41ad8c9a93668c481436fc4a5e47e6f14776e7.tar.bz2 llvm-6c41ad8c9a93668c481436fc4a5e47e6f14776e7.tar.xz |
fix PR6623: when optimizing for size, don't inline memcpy/memsets
that are too large. This causes the freebsd bootloader to be too
large apparently.
It's unclear if this should be an -Os or -Oz thing. Thoughts welcome.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/memcpy.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGen/X86/memcpy.ll b/test/CodeGen/X86/memcpy.ll index 16bf7c5a38..7bc31bec16 100644 --- a/test/CodeGen/X86/memcpy.ll +++ b/test/CodeGen/X86/memcpy.ll @@ -25,3 +25,33 @@ entry: ; CHECK: memcpy } +; Large constant memcpy's should lower to a call when optimizing for size. +; PR6623 +define void @test3(i8* nocapture %A, i8* nocapture %B) nounwind optsize noredzone { +entry: + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i32 1, i1 false) + ret void +; CHECK: test3: +; CHECK: memcpy +} + +; Large constant memcpy's should be inlined when not optimizing for size. +define void @test4(i8* nocapture %A, i8* nocapture %B) nounwind noredzone { +entry: + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i32 1, i1 false) + ret void +; CHECK: test4: +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +; CHECK: movq +} + |