summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-04-25 21:13:29 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-04-25 21:13:29 +0000
commitb9f07e3dbc741b3326a3c22f6b255dc350ccb6df (patch)
tree3426cb159e24b63b3564dab9ddfe2e7436d9e41a /clang/lib/CodeGen
parent4316df592152f4bf1151dbe89ddb3312c34ded3f (diff)
downloadbcm5719-llvm-b9f07e3dbc741b3326a3c22f6b255dc350ccb6df.tar.gz
bcm5719-llvm-b9f07e3dbc741b3326a3c22f6b255dc350ccb6df.zip
CodeGen: add __yield intrinsic for ARM
The __yield intrinsic generates a hint instruction to indicate that the thread is not performing any useful operations at the moment. This is for compatibility with MSVC, although, the intrinsic is also part of the ACLE, and is enabled globally as a result. llvm-svn: 207275
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index d267ecee73e..56fa69aec53 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -4326,6 +4326,11 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
const CallExpr *E) {
+ if (BuiltinID == ARM::BI__yield) {
+ Function *F = CGM.getIntrinsic(Intrinsic::arm_hint);
+ return Builder.CreateCall(F, llvm::ConstantInt::get(Int32Ty, 1));
+ }
+
if (BuiltinID == ARM::BI__clear_cache) {
assert(E->getNumArgs() == 2 && "__clear_cache takes 2 arguments");
const FunctionDecl *FD = E->getDirectCallee();
OpenPOWER on IntegriCloud