summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-03-11 10:49:03 +0000
committerTim Northover <tnorthover@apple.com>2014-03-11 10:49:03 +0000
commit0622b3a67af7545fa634c7fa98407f570a01d7b0 (patch)
tree4b8fdab5e79b312e4c076b88f09ee748dd957198 /clang/lib/CodeGen/CGBuiltin.cpp
parente94a518a22db4b21f4a4a9e34173a11e9dfc5fcc (diff)
downloadbcm5719-llvm-0622b3a67af7545fa634c7fa98407f570a01d7b0.tar.gz
bcm5719-llvm-0622b3a67af7545fa634c7fa98407f570a01d7b0.zip
Update for IR: add a second AtomicOrdering to cmpxchg insts.
rdar://problem/15996804 llvm-svn: 203560
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 39664192081..76493254e71 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -964,6 +964,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
Args[2] = EmitToInt(*this, EmitScalarExpr(E->getArg(2)), T, IntType);
Value *Result = Builder.CreateAtomicCmpXchg(Args[0], Args[1], Args[2],
+ llvm::SequentiallyConsistent,
llvm::SequentiallyConsistent);
Result = EmitFromInt(*this, Result, T, ValueType);
return RValue::get(Result);
@@ -990,6 +991,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
Value *OldVal = Args[1];
Value *PrevVal = Builder.CreateAtomicCmpXchg(Args[0], Args[1], Args[2],
+ llvm::SequentiallyConsistent,
llvm::SequentiallyConsistent);
Value *Result = Builder.CreateICmpEQ(PrevVal, OldVal);
// zext bool to int.
@@ -1504,6 +1506,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
EmitScalarExpr(E->getArg(0)),
EmitScalarExpr(E->getArg(2)),
EmitScalarExpr(E->getArg(1)),
+ SequentiallyConsistent,
SequentiallyConsistent);
CXI->setVolatile(true);
return RValue::get(CXI);
OpenPOWER on IntegriCloud