From: Dan Gohman Date: Tue, 1 Apr 2008 20:56:18 +0000 (+0000) Subject: Don't use __bzero for memset if the second argument isn't zero. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=38c92263eb83f556cdea8bf55b6d7dcc47ce131d;p=oota-llvm.git 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 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index f4ec6afd540..162979b8039 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(Op.getOperand(2)); + const char *bzeroEntry = + V && V->isNullValue() ? Subtarget->getBZeroEntry() : 0; MVT::ValueType IntPtr = getPointerTy(); const Type *IntPtrTy = getTargetData()->getIntPtrType();