aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2007-10-31 14:39:58 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2007-10-31 14:39:58 +0000
commite0703c84ddeb1a1276de4e38210c1127ef5df130 (patch)
tree73f530a14fad1ce3e665e50ebf3e42344371556d /lib/Target/X86
parenta24b294e740b552c23bc4bbeda694c4d995d4134 (diff)
downloadexternal_llvm-e0703c84ddeb1a1276de4e38210c1127ef5df130.zip
external_llvm-e0703c84ddeb1a1276de4e38210c1127ef5df130.tar.gz
external_llvm-e0703c84ddeb1a1276de4e38210c1127ef5df130.tar.bz2
Make ARM and X86 LowerMEMCPY identical by moving the isThumb check into getMaxInlineSizeThreshold
and by restructuring the X86 version. New I just have to move this to a common place :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index f1bf150..3180e64 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -4496,24 +4496,17 @@ SDOperand X86TargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG &DAG) {
assert(!AlwaysInline && "Cannot inline copy of unknown size");
return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
}
- unsigned Size = I->getValue();
-
- if (AlwaysInline)
- return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, Align, DAG);
+ // If not DWORD aligned or if size is more than threshold, then call memcpy.
// The libc version is likely to be faster for the following cases. It can
// use the address value and run time information about the CPU.
// With glibc 2.6.1 on a core 2, coping an array of 100M longs was 30% faster
-
- // If not DWORD aligned, call memcpy.
- if ((Align & 3) != 0)
- return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
-
- // If size is more than the threshold, call memcpy.
- if (Size > Subtarget->getMaxInlineSizeThreshold())
- return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
-
- return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, Align, DAG);
+ unsigned Size = I->getValue();
+ if (AlwaysInline ||
+ (Size <= Subtarget->getMaxInlineSizeThreshold() &&
+ (Align & 3) == 0))
+ return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, Align, DAG);
+ return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
}
SDOperand X86TargetLowering::LowerMEMCPYCall(SDOperand Chain,