summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-04-01 20:56:18 +0000
committerDan Gohman <gohman@apple.com>2008-04-01 20:56:18 +0000
commitcb9f8f6e4e45b2e41260f9b825620a9609ec2e3b (patch)
tree9f9da936cad597a06249da258309050de4416a33 /llvm/lib
parentbf1a7c64409a056cbf0d6081f66585ae77e5a416 (diff)
downloadbcm5719-llvm-cb9f8f6e4e45b2e41260f9b825620a9609ec2e3b.tar.gz
bcm5719-llvm-cb9f8f6e4e45b2e41260f9b825620a9609ec2e3b.zip
Don't use __bzero for memset if the second argument isn't zero.
llvm-svn: 49050
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index f4ec6afd540..162979b8039 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud