diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2007-08-27 10:18:20 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2007-08-27 10:18:20 +0000 |
commit | 5d3e762cadf98ff20daefc4407435b2a0ff98b64 (patch) | |
tree | c66d22904e779c42f651ed9057b19a632f7fa62f /lib | |
parent | 37ed3a41fbeb0c7ccafa1536718ae71ca76bf5a7 (diff) | |
download | external_llvm-5d3e762cadf98ff20daefc4407435b2a0ff98b64.tar.gz external_llvm-5d3e762cadf98ff20daefc4407435b2a0ff98b64.tar.bz2 external_llvm-5d3e762cadf98ff20daefc4407435b2a0ff98b64.zip |
call libc memcpy/memset if array size is bigger then threshold.
Coping 100MB array (after a warmup) shows that glibc 2.6.1 implementation on
x86-64 (core 2) is 30% faster (from 0.270917s to 0.188079s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41479 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 6673c5f639..75fbd4490a 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -3753,10 +3753,10 @@ SDOperand X86TargetLowering::LowerMEMSET(SDOperand Op, SelectionDAG &DAG) { if (Align == 0) Align = 1; ConstantSDNode *I = dyn_cast<ConstantSDNode>(Op.getOperand(3)); - // If not DWORD aligned, call memset if size is less than the threshold. + // If not DWORD aligned or size is more than the threshold, call memset. // It knows how to align to the right boundary first. if ((Align & 3) != 0 || - (I && I->getValue() < Subtarget->getMinRepStrSizeThreshold())) { + (I && I->getValue() > Subtarget->getMinRepStrSizeThreshold())) { MVT::ValueType IntPtr = getPointerTy(); const Type *IntPtrTy = getTargetData()->getIntPtrType(); TargetLowering::ArgListTy Args; @@ -3909,10 +3909,10 @@ SDOperand X86TargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG &DAG) { if (Align == 0) Align = 1; ConstantSDNode *I = dyn_cast<ConstantSDNode>(Op.getOperand(3)); - // If not DWORD aligned, call memcpy if size is less than the threshold. + // If not DWORD aligned or size is more than the threshold, call memcpy. // It knows how to align to the right boundary first. if ((Align & 3) != 0 || - (I && I->getValue() < Subtarget->getMinRepStrSizeThreshold())) { + (I && I->getValue() > Subtarget->getMinRepStrSizeThreshold())) { MVT::ValueType IntPtr = getPointerTy(); TargetLowering::ArgListTy Args; TargetLowering::ArgListEntry Entry; |