llvm.org GIT mirror llvm / 06626a6
Fix swapped CASA operands. Found by SingleSource/UnitTests/AtomicOps.c git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200130 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 6 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
29762976 // loop:
29772977 // %val = phi %val0, %dest
29782978 // %upd = op %val, %rs2
2979 // %dest = cas %addr, %upd, %val
2979 // %dest = cas %addr, %val, %upd
29802980 // cmp %val, %dest
29812981 // bne loop
29822982 // done:
30353035 }
30363036
30373037 BuildMI(LoopMBB, DL, TII.get(is64Bit ? SP::CASXrr : SP::CASrr), DestReg)
3038 .addReg(AddrReg).addReg(UpdReg).addReg(ValReg)
3038 .addReg(AddrReg).addReg(ValReg).addReg(UpdReg)
30393039 .setMemRefs(MI->memoperands_begin(), MI->memoperands_end());
30403040 BuildMI(LoopMBB, DL, TII.get(SP::CMPrr)).addReg(ValReg).addReg(DestReg);
30413041 BuildMI(LoopMBB, DL, TII.get(is64Bit ? SP::BPXCC : SP::BCOND))
6363
6464 ; CHECK-LABEL: test_load_add_32
6565 ; CHECK: membar
66 ; CHECK: add
67 ; CHECK: cas [%o0]
66 ; CHECK: add [[V:%[gilo][0-7]]], %o1, [[U:%[gilo][0-7]]]
67 ; CHECK: cas [%o0], [[V]], [[U]]
6868 ; CHECK: membar
6969 define zeroext i32 @test_load_add_32(i32* %p, i32 zeroext %v) {
7070 entry: