summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2007-10-31 11:52:06 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2007-10-31 11:52:06 +0000
commit063f1773001bbe8a86303ff31e1d41a0b8dee0ef (patch)
treeca36762a30317baff403381f6c6fff3ad6b5e312 /llvm
parent3b4668a5d8c614b165648b080f6e48e9e87f9f54 (diff)
downloadbcm5719-llvm-063f1773001bbe8a86303ff31e1d41a0b8dee0ef.tar.gz
bcm5719-llvm-063f1773001bbe8a86303ff31e1d41a0b8dee0ef.zip
Make ARM an X86 memcpy expansion more similar to each other.
Now both subtarget define getMaxInlineSizeThreshold and the expansion uses it. This should not change generated code. llvm-svn: 43552
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp3
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h1
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp4
-rw-r--r--llvm/lib/Target/X86/X86Subtarget.cpp2
-rw-r--r--llvm/lib/Target/X86/X86Subtarget.h12
5 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 154832b62bd..ef1c86d22a8 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -1315,7 +1315,8 @@ SDOperand ARMTargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG &DAG,
// this once Thumb ldmia / stmia support is added.
unsigned Size = I->getValue();
if (AlwaysInline ||
- (!ST->isThumb() && Size < 64 && (Align & 3) == 0))
+ (!ST->isThumb() && Size <= Subtarget->getMaxInlineSizeThreshold() &&
+ (Align & 3) == 0))
return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, Align, DAG);
return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
}
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 62367cadb91..5b5ee39ced0 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -62,6 +62,7 @@ protected:
///
ARMSubtarget(const Module &M, const std::string &FS, bool thumb);
+ unsigned getMaxInlineSizeThreshold() const { return 64; }
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 17c7534377d..f1bf150e1f9 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -4332,7 +4332,7 @@ SDOperand X86TargetLowering::LowerMEMSET(SDOperand Op, SelectionDAG &DAG) {
// The libc version is likely to be faster for these cases. It can use the
// address value and run time information about the CPU.
if ((Align & 3) != 0 ||
- (I && I->getValue() > Subtarget->getMinRepStrSizeThreshold())) {
+ (I && I->getValue() > Subtarget->getMaxInlineSizeThreshold())) {
MVT::ValueType IntPtr = getPointerTy();
const Type *IntPtrTy = getTargetData()->getIntPtrType();
TargetLowering::ArgListTy Args;
@@ -4510,7 +4510,7 @@ SDOperand X86TargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG &DAG) {
return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
// If size is more than the threshold, call memcpy.
- if (Size > Subtarget->getMinRepStrSizeThreshold())
+ if (Size > Subtarget->getMaxInlineSizeThreshold())
return LowerMEMCPYCall(ChainOp, DestOp, SourceOp, CountOp, DAG);
return LowerMEMCPYInline(ChainOp, DestOp, SourceOp, Size, Align, DAG);
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 51406c39279..2ddf9e2d2a3 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -223,7 +223,7 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
, HasX86_64(false)
, stackAlignment(8)
// FIXME: this is a known good value for Yonah. How about others?
- , MinRepStrSizeThreshold(128)
+ , MaxInlineSizeThreshold(128)
, Is64Bit(is64Bit)
, HasLow4GUserAddress(true)
, TargetType(isELF) { // Default to ELF unless otherwise specified.
diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h
index d939bc00c54..c0a4f2410c0 100644
--- a/llvm/lib/Target/X86/X86Subtarget.h
+++ b/llvm/lib/Target/X86/X86Subtarget.h
@@ -69,9 +69,9 @@ protected:
/// entry to the function and which must be maintained by every function.
unsigned stackAlignment;
- /// Min. memset / memcpy size that is turned into rep/movs, rep/stos ops.
+ /// Max. memset / memcpy size that is turned into rep/movs, rep/stos ops.
///
- unsigned MinRepStrSizeThreshold;
+ unsigned MaxInlineSizeThreshold;
private:
/// Is64Bit - True if the processor supports 64-bit instructions and module
@@ -97,11 +97,9 @@ public:
/// function for this subtarget.
unsigned getStackAlignment() const { return stackAlignment; }
- /// getMinRepStrSizeThreshold - Returns the minimum memset / memcpy size
- /// required to turn the operation into a X86 rep/movs or rep/stos
- /// instruction. This is only used if the src / dst alignment is not DWORD
- /// aligned.
- unsigned getMinRepStrSizeThreshold() const { return MinRepStrSizeThreshold; }
+ /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
+ /// that still makes it profitable to inline the call.
+ unsigned getMaxInlineSizeThreshold() const { return MaxInlineSizeThreshold; }
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
OpenPOWER on IntegriCloud