aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-07-29 03:05:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-07-29 03:05:32 +0000
commit55ba816883842e793cdeb32fcb805c4e011b527f (patch)
treeb5e5430210f42121d6ff2696e5495972271bbdf5 /include/llvm/Support
parente0058b4b0c4d162a3b3ff2ad8a87c979928ba016 (diff)
downloadexternal_llvm-55ba816883842e793cdeb32fcb805c4e011b527f.zip
external_llvm-55ba816883842e793cdeb32fcb805c4e011b527f.tar.gz
external_llvm-55ba816883842e793cdeb32fcb805c4e011b527f.tar.bz2
Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to be
working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/IRBuilder.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index 542ee10..22bec42 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -770,6 +770,16 @@ public:
SynchronizationScope SynchScope = CrossThread) {
return Insert(new FenceInst(Context, Ordering, SynchScope));
}
+ FenceInst *CreateAtomicCmpXchg(Value *Ptr, Value *Cmp, Value *New,
+ AtomicOrdering Ordering,
+ SynchronizationScope SynchScope = CrossThread){
+ return Insert(new AtomicCmpXchgInst(Ptr, Cmp, New, Ordering, SynchScope));
+ }
+ FenceInst *CreateAtomicRMW(AtomicRMWInst::BinOp Op, Value *Ptr, Value *Val,
+ AtomicOrdering Ordering,
+ SynchronizationScope SynchScope = CrossThread) {
+ return Insert(new AtomicRMWInst(Op, Ptr, Val, Ordering, SynchScope));
+ }
Value *CreateGEP(Value *Ptr, ArrayRef<Value *> IdxList,
const Twine &Name = "") {
if (Constant *PC = dyn_cast<Constant>(Ptr)) {