summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-06-13 16:45:36 +0000
committerTim Northover <tnorthover@apple.com>2014-06-13 16:45:36 +0000
commitd039abdeeb2ac2476277c275ed4065440ef1fbb0 (patch)
treeae41cbcc1c1076e12eaa97d2c62197e97c1449ad /llvm/lib/CodeGen
parentbc5b5370de681de16e290a1dd822ee87ee4a8583 (diff)
downloadbcm5719-llvm-d039abdeeb2ac2476277c275ed4065440ef1fbb0.tar.gz
bcm5719-llvm-d039abdeeb2ac2476277c275ed4065440ef1fbb0.zip
Atomics: switch direction of cmpxchg comparison
This has two benefits: it makes the result more suitable for direct insertaion into the struct to emulate the new cmpxchg, and it means the name we give the instruction matches its actual effect better. llvm-svn: 210916
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp b/llvm/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp
index 6f93ced85b0..6d66e56d426 100644
--- a/llvm/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp
@@ -283,9 +283,9 @@ bool AtomicExpandLoadLinked::expandAtomicCmpXchg(AtomicCmpXchgInst *CI) {
Builder.SetInsertPoint(TryStoreBB);
Value *StoreSuccess = TLI->emitStoreConditional(
Builder, CI->getNewValOperand(), Addr, MemOpOrder);
- Value *TryAgain = Builder.CreateICmpNE(
+ StoreSuccess = Builder.CreateICmpEQ(
StoreSuccess, ConstantInt::get(Type::getInt32Ty(Ctx), 0), "success");
- Builder.CreateCondBr(TryAgain, LoopBB, BarrierBB);
+ Builder.CreateCondBr(StoreSuccess, BarrierBB, LoopBB);
// Make sure later instructions don't get reordered with a fence if necessary.
Builder.SetInsertPoint(BarrierBB);
OpenPOWER on IntegriCloud