From 68f12ee567f797c82398df20c20f0b5db27bcab3 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 1 Oct 2008 00:59:58 +0000 Subject: Implement the -fno-builtin option in the front-end, not in the back-end. llvm-svn: 56900 --- llvm/lib/Target/X86/X86ISelLowering.cpp | 37 +++++++++++++++------------------ llvm/lib/Target/X86/X86ISelLowering.h | 3 +-- 2 files changed, 18 insertions(+), 22 deletions(-) (limited to 'llvm/lib/Target') diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 755554ba282..3bff205b991 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5132,8 +5132,7 @@ X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, const Value *DstSV, - uint64_t DstSVOff, - bool NoBuiltin) { + uint64_t DstSVOff) { ConstantSDNode *ConstantSize = dyn_cast(Size); // If not DWORD aligned or size is more than the threshold, call the library. @@ -5148,24 +5147,22 @@ X86TargetLowering::EmitTargetCodeForMemset(SelectionDAG &DAG, // Check to see if there is a specialized entry-point for memory zeroing. ConstantSDNode *V = dyn_cast(Src); - if (!NoBuiltin) { - if (const char *bzeroEntry = V && - V->isNullValue() ? Subtarget->getBZeroEntry() : 0) { - MVT IntPtr = getPointerTy(); - const Type *IntPtrTy = TD->getIntPtrType(); - TargetLowering::ArgListTy Args; - TargetLowering::ArgListEntry Entry; - Entry.Node = Dst; - Entry.Ty = IntPtrTy; - Args.push_back(Entry); - Entry.Node = Size; - Args.push_back(Entry); - std::pair CallResult = - LowerCallTo(Chain, Type::VoidTy, false, false, false, false, - CallingConv::C, false, - DAG.getExternalSymbol(bzeroEntry, IntPtr), Args, DAG); - return CallResult.second; - } + if (const char *bzeroEntry = V && + V->isNullValue() ? Subtarget->getBZeroEntry() : 0) { + MVT IntPtr = getPointerTy(); + const Type *IntPtrTy = TD->getIntPtrType(); + TargetLowering::ArgListTy Args; + TargetLowering::ArgListEntry Entry; + Entry.Node = Dst; + Entry.Ty = IntPtrTy; + Args.push_back(Entry); + Entry.Node = Size; + Args.push_back(Entry); + std::pair CallResult = + LowerCallTo(Chain, Type::VoidTy, false, false, false, false, + CallingConv::C, false, + DAG.getExternalSymbol(bzeroEntry, IntPtr), Args, DAG); + return CallResult.second; } // Otherwise have the target-independent code call memset. diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h index 5cdb65dd95e..54a74533eb3 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -578,8 +578,7 @@ namespace llvm { SDValue Chain, SDValue Dst, SDValue Src, SDValue Size, unsigned Align, - const Value *DstSV, uint64_t DstSVOff, - bool NoBuiltin); + const Value *DstSV, uint64_t DstSVOff); SDValue EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDValue Chain, SDValue Dst, SDValue Src, -- cgit v1.2.3