Implement the -fno-builtin option in the front-end, not in the back-end.
authorBill Wendling <isanbard@gmail.com>
Wed, 1 Oct 2008 00:59:58 +0000 (00:59 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 1 Oct 2008 00:59:58 +0000 (00:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56900 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h

index cec7aa74c107e6596007cc100d818dbbc3578800..2f8758b4ef28a734864d1e1f3f085cb303ed68ad 100644 (file)
@@ -1049,8 +1049,7 @@ public:
                           SDValue Chain,
                           SDValue Op1, SDValue Op2,
                           SDValue Op3, unsigned Align,
-                          const Value *DstSV, uint64_t DstOff,
-                          bool NoBuiltin = false) {
+                          const Value *DstSV, uint64_t DstOff) {
     return SDValue();
   }
 
index 37297d6dccd448bfb2cbf625d7be26bfdbb21661..eba3a2a9ce410b27967a5f722fcab37542ccdf11 100644 (file)
 #include <cmath>
 using namespace llvm;
 
-static cl::opt<bool>
-NoBuiltin("no-builtin", cl::init(false),
-           cl::desc("Don't recognize built-in functions that do not begin "
-                    "with `__builtin_' as prefix"));
-
 /// makeVTList - Return an instance of the SDVTList struct initialized with the
 /// specified members.
 static SDVTList makeVTList(const MVT *VTs, unsigned NumVTs) {
@@ -3195,7 +3190,7 @@ SDValue SelectionDAG::getMemset(SDValue Chain, SDValue Dst,
   // code. If the target chooses to do this, this is the next best.
   SDValue Result =
     TLI.EmitTargetCodeForMemset(*this, Chain, Dst, Src, Size, Align,
-                                DstSV, DstSVOff, NoBuiltin);
+                                DstSV, DstSVOff);
   if (Result.getNode())
     return Result;
 
index 755554ba28274b43930de24aa7abd4449f60945d..3bff205b991c052d0e0f3289399c9f08c095eb59 100644 (file)
@@ -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<ConstantSDNode>(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<ConstantSDNode>(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<SDValue,SDValue> 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<SDValue,SDValue> 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.
index 5cdb65dd95e7560120901257575c056d3a4deb9e..54a74533eb3a3fc37054786303f0cb03ea08b387 100644 (file)
@@ -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,