]> granicus.if.org Git - clang/commitdiff
Revert commit r160308. We decide to move builtins selection to the backend.
authorSimon Atanasyan <satanasyan@mips.com>
Tue, 17 Jul 2012 08:15:06 +0000 (08:15 +0000)
committerSimon Atanasyan <satanasyan@mips.com>
Tue, 17 Jul 2012 08:15:06 +0000 (08:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160353 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGBuiltin.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGen/builtins-mips-ovld.c [deleted file]

index 174e2cbdf51f2ca9ba4365bea26ec6437d1a6692..dd04a464e19adc1f7854ce227464701b5c2901f5 100644 (file)
@@ -1378,11 +1378,6 @@ Value *CodeGenFunction::EmitTargetBuiltinExpr(unsigned BuiltinID,
   case llvm::Triple::ppc:
   case llvm::Triple::ppc64:
     return EmitPPCBuiltinExpr(BuiltinID, E);
-  case llvm::Triple::mips:
-  case llvm::Triple::mipsel:
-  case llvm::Triple::mips64:
-  case llvm::Triple::mips64el:
-    return EmitMipsBuiltinExpr(BuiltinID, E);
   default:
     return 0;
   }
@@ -2568,27 +2563,3 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID,
   }
   }
 }
-
-Value *CodeGenFunction::EmitMipsBuiltinExpr(unsigned BuiltinID,
-                                            const CallExpr *E) {
-  SmallVector<Value*, 4> Ops;
-
-  for (unsigned i = 0, e = E->getNumArgs(); i != e; i++)
-    Ops.push_back(EmitScalarExpr(E->getArg(i)));
-
-  Intrinsic::ID ID = Intrinsic::not_intrinsic;
-
-  switch (BuiltinID) {
-  default: return 0;
-  case Mips::BI__builtin_mips_shll_qb:
-    llvm::APSInt Value;
-    if (E->getArg(1)->isIntegerConstantExpr(Value, getContext()))
-      ID = Intrinsic::mips_shll_qb;
-    else
-      ID = Intrinsic::mips_shll_qb_v;
-    break;
-  }
-
-  llvm::Function *F = CGM.getIntrinsic(ID);
-  return Builder.CreateCall(F, Ops, "");
-}
index 82423f5c303f482bea2e15655ae5e1c70a03e7e1..b737a9ed7ab739d5a404967875ae36849af0a81a 100644 (file)
@@ -2276,7 +2276,6 @@ public:
   llvm::Value *BuildVector(ArrayRef<llvm::Value*> Ops);
   llvm::Value *EmitX86BuiltinExpr(unsigned BuiltinID, const CallExpr *E);
   llvm::Value *EmitPPCBuiltinExpr(unsigned BuiltinID, const CallExpr *E);
-  llvm::Value *EmitMipsBuiltinExpr(unsigned BuiltinID, const CallExpr *E);
 
   llvm::Value *EmitObjCProtocolExpr(const ObjCProtocolExpr *E);
   llvm::Value *EmitObjCStringLiteral(const ObjCStringLiteral *E);
diff --git a/test/CodeGen/builtins-mips-ovld.c b/test/CodeGen/builtins-mips-ovld.c
deleted file mode 100644 (file)
index b3460ab..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// REQUIRES: mips-registered-target
-// RUN: %clang_cc1 -triple mips-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s
-
-typedef signed char v4i8 __attribute__ ((vector_size(4)));
-
-void foo() {
-  v4i8 a = {1, 2, 3, 4};
-  int shift = 1;
-// CHECK: {{%.*}} = call <4 x i8> @llvm.mips.shll.qb(<4 x i8> {{%.*}}, i32 1)
-  v4i8 r1 = __builtin_mips_shll_qb(a, 1);
-// CHECK: {{%.*}} = call <4 x i8> @llvm.mips.shll.qb.v(<4 x i8> {{%.*}}, i32 {{%.*}})
-  v4i8 r2 = __builtin_mips_shll_qb(a, shift);
-}