diff options
author | Dan Gohman <gohman@apple.com> | 2008-04-12 04:36:06 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-04-12 04:36:06 +0000 |
commit | 707e0184233f27e0e9f9aee0309f2daab8cfe7f8 (patch) | |
tree | 849460e92ec614c23849f147402c15384fe11756 /test/CodeGen/X86/small-byval-memcpy.ll | |
parent | 6f836adafee88669273e9302e3344c4b9cef8a0d (diff) | |
download | external_llvm-707e0184233f27e0e9f9aee0309f2daab8cfe7f8.zip external_llvm-707e0184233f27e0e9f9aee0309f2daab8cfe7f8.tar.gz external_llvm-707e0184233f27e0e9f9aee0309f2daab8cfe7f8.tar.bz2 |
Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal
on any current target and aren't optimized in DAGCombiner. Instead
of using intermediate nodes, expand the operations, choosing between
simple loads/stores, target-specific code, and library calls,
immediately.
Previously, the code to emit optimized code for these operations
was only used at initial SelectionDAG construction time; now it is
used at all times. This fixes some cases where rep;movs was being
used for small copies where simple loads/stores would be better.
This also cleans up code that checks for alignments less than 4;
let the targets make that decision instead of doing it in
target-independent code. This allows x86 to use rep;movs in
low-alignment cases.
Also, this fixes a bug that resulted in the use of rep;stos for
memsets of 0 with non-constant memory size when the alignment was
at least 4. It's better to use the library in this case, which
can be significantly faster when the size is large.
This also preserves more SourceValue information when memory
intrinsics are lowered into simple loads/stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/small-byval-memcpy.ll')
-rw-r--r-- | test/CodeGen/X86/small-byval-memcpy.ll | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/X86/small-byval-memcpy.ll b/test/CodeGen/X86/small-byval-memcpy.ll new file mode 100644 index 0000000..dedd948 --- /dev/null +++ b/test/CodeGen/X86/small-byval-memcpy.ll @@ -0,0 +1,22 @@ +; RUN: llvm-as < %s | llc | not grep movs + +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" +target triple = "i386-apple-darwin8" + +define void @ccosl({ x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %z) nounwind { +entry: + %iz = alloca { x86_fp80, x86_fp80 } ; <{ x86_fp80, x86_fp80 }*> [#uses=3] + %tmp1 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 1 ; <x86_fp80*> [#uses=1] + %tmp2 = load x86_fp80* %tmp1, align 16 ; <x86_fp80> [#uses=1] + %tmp3 = sub x86_fp80 0xK80000000000000000000, %tmp2 ; <x86_fp80> [#uses=1] + %tmp4 = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 1 ; <x86_fp80*> [#uses=1] + %real = getelementptr { x86_fp80, x86_fp80 }* %iz, i32 0, i32 0 ; <x86_fp80*> [#uses=1] + %tmp6 = getelementptr { x86_fp80, x86_fp80 }* %z, i32 0, i32 0 ; <x86_fp80*> [#uses=1] + %tmp7 = load x86_fp80* %tmp6, align 16 ; <x86_fp80> [#uses=1] + store x86_fp80 %tmp3, x86_fp80* %real, align 16 + store x86_fp80 %tmp7, x86_fp80* %tmp4, align 16 + call void @ccoshl( { x86_fp80, x86_fp80 }* noalias sret %agg.result, { x86_fp80, x86_fp80 }* byval align 4 %iz ) nounwind + ret void +} + +declare void @ccoshl({ x86_fp80, x86_fp80 }* noalias sret , { x86_fp80, x86_fp80 }* byval align 4 ) nounwind |