mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-21 18:24:23 +00:00
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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user