diff options
| author | Tim Northover <tnorthover@apple.com> | 2014-03-11 10:49:03 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2014-03-11 10:49:03 +0000 |
| commit | 0622b3a67af7545fa634c7fa98407f570a01d7b0 (patch) | |
| tree | 4b8fdab5e79b312e4c076b88f09ee748dd957198 /clang/lib/CodeGen/CGBuiltin.cpp | |
| parent | e94a518a22db4b21f4a4a9e34173a11e9dfc5fcc (diff) | |
| download | bcm5719-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.cpp | 3 |
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); |

