diff options
author | Tim Northover <tnorthover@apple.com> | 2014-06-13 16:45:36 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-06-13 16:45:36 +0000 |
commit | 6b3ed2b8214778b8eedae81be5193d1b89c49a66 (patch) | |
tree | 8d88e0ab73e93a7addffee96964206e7d322780e /lib/CodeGen | |
parent | 61bc72e9ae25b6706d9a3a90a72e6d55a0d22b43 (diff) | |
download | llvm-6b3ed2b8214778b8eedae81be5193d1b89c49a66.tar.gz llvm-6b3ed2b8214778b8eedae81be5193d1b89c49a66.tar.bz2 llvm-6b3ed2b8214778b8eedae81be5193d1b89c49a66.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AtomicExpandLoadLinkedPass.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp b/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp index 6f93ced85b..6d66e56d42 100644 --- a/lib/CodeGen/AtomicExpandLoadLinkedPass.cpp +++ b/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); |