diff options
author | Dan Gohman <gohman@apple.com> | 2008-04-01 20:56:18 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-04-01 20:56:18 +0000 |
commit | 38c92263eb83f556cdea8bf55b6d7dcc47ce131d (patch) | |
tree | beaaad06b3b34645151973151859925e4d821596 | |
parent | 68d599df37218452acd5a680d5360d3caaa1623c (diff) |
Don't use __bzero for memset if the second argument isn't zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49050 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index f4ec6afd54..162979b803 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -4562,8 +4562,9 @@ SDOperand X86TargetLowering::LowerMEMSET(SDOperand Op, SelectionDAG &DAG) { (I && I->getValue() > Subtarget->getMaxInlineSizeThreshold())) { // Check to see if there is a specialized entry-point for memory zeroing. - const char *bzeroEntry = Subtarget->getBZeroEntry(); ConstantSDNode *V = dyn_cast<ConstantSDNode>(Op.getOperand(2)); + const char *bzeroEntry = + V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0; MVT::ValueType IntPtr = getPointerTy(); const Type *IntPtrTy = getTargetData()->getIntPtrType(); |