diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2007-08-27 17:48:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2007-08-27 17:48:26 +0000 |
commit | b2e7a6ba64fe6ef2c62668ef6d42b09671fc8804 (patch) | |
tree | ea9054bc5dbb0b19dc6132c33dfd8f90c4c52841 /lib/Target | |
parent | b4e8c90c4ce0c0bfdc9dddf3851bc243559d03a9 (diff) | |
download | external_llvm-b2e7a6ba64fe6ef2c62668ef6d42b09671fc8804.zip external_llvm-b2e7a6ba64fe6ef2c62668ef6d42b09671fc8804.tar.gz external_llvm-b2e7a6ba64fe6ef2c62668ef6d42b09671fc8804.tar.bz2 |
Add a comment about using libc memset/memcpy or generating inline code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 75fbd44..2e9dce3 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -3754,7 +3754,8 @@ SDOperand X86TargetLowering::LowerMEMSET(SDOperand Op, SelectionDAG &DAG) { ConstantSDNode *I = dyn_cast<ConstantSDNode>(Op.getOperand(3)); // If not DWORD aligned or size is more than the threshold, call memset. - // It knows how to align to the right boundary first. + // 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())) { MVT::ValueType IntPtr = getPointerTy(); @@ -3910,7 +3911,9 @@ SDOperand X86TargetLowering::LowerMEMCPY(SDOperand Op, SelectionDAG &DAG) { ConstantSDNode *I = dyn_cast<ConstantSDNode>(Op.getOperand(3)); // If not DWORD aligned or size is more than the threshold, call memcpy. - // It knows how to align to the right boundary first. + // The libc version is likely to be faster for these 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 ((Align & 3) != 0 || (I && I->getValue() > Subtarget->getMinRepStrSizeThreshold())) { MVT::ValueType IntPtr = getPointerTy(); |