Don't use __bzero for memset if the second argument isn't zero.
llvm-svn: 49050
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f4ec6af..162979b 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -4562,8 +4562,9 @@
(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();