Build and insert OldValRes<def> = G_ATOMICRMW_XCHG Addr, Val, MMO.
Declared in <llvm/CodeGen/GlobalISel/MachineIRBuilder.h>
MachineInstrBuilder
buildAtomicRMWXchg(
Register OldValRes,
Register Addr,
Register Val,
MachineMemOperand& MMO);
Atomically replace the value at Addr with Val. Puts the original value from Addr in OldValRes.
a MachineInstrBuilder for the newly created instruction.
| Name | Description |
|---|---|
| OldValRes | Destination receiving the previous memory value. |
| Addr | Address operand. |
| Val | Value operand. |
| MMO | Memory operand describing the access. |
OldValRes must be a generic virtual register.Addr must be a generic virtual register with pointer type.OldValRes, and Val must be generic virtual registers of the same type.