mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 03:23:01 +02:00
Relax the MemOperands on atomics a bit. Fixes -verify-machineinstrs failures for atomic laod/store on ARM.
(The fix for the related failures on x86 is going to be nastier because we actually need Acquire memoperands attached to the atomic load instrs, etc.) llvm-svn: 139221
This commit is contained in:
parent
9fa9ed6961
commit
6a45370c0f
@ -998,8 +998,10 @@ class AtomicSDNode : public MemSDNode {
|
|||||||
assert(getOrdering() == Ordering && "Ordering encoding error!");
|
assert(getOrdering() == Ordering && "Ordering encoding error!");
|
||||||
assert(getSynchScope() == SynchScope && "Synch-scope encoding error!");
|
assert(getSynchScope() == SynchScope && "Synch-scope encoding error!");
|
||||||
|
|
||||||
assert(readMem() && "Atomic MachineMemOperand is not a load!");
|
assert((readMem() || getOrdering() <= Monotonic) &&
|
||||||
assert(writeMem() && "Atomic MachineMemOperand is not a store!");
|
"Acquire/Release MachineMemOperand must be a load!");
|
||||||
|
assert((writeMem() || getOrdering() <= Monotonic) &&
|
||||||
|
"Acquire/Release MachineMemOperand must be a store!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -3840,6 +3840,8 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT,
|
|||||||
unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
|
unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
|
||||||
|
|
||||||
// For now, atomics are considered to be volatile always.
|
// For now, atomics are considered to be volatile always.
|
||||||
|
// FIXME: Volatile isn't really correct; we should keep track of atomic
|
||||||
|
// orderings in the memoperand.
|
||||||
Flags |= MachineMemOperand::MOVolatile;
|
Flags |= MachineMemOperand::MOVolatile;
|
||||||
|
|
||||||
MachineMemOperand *MMO =
|
MachineMemOperand *MMO =
|
||||||
@ -3889,9 +3891,16 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT,
|
|||||||
Alignment = getEVTAlignment(MemVT);
|
Alignment = getEVTAlignment(MemVT);
|
||||||
|
|
||||||
MachineFunction &MF = getMachineFunction();
|
MachineFunction &MF = getMachineFunction();
|
||||||
unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
|
// A monotonic store does not load; a release store "loads" in the sense
|
||||||
|
// that other stores cannot be sunk past it.
|
||||||
|
// (An atomicrmw obviously both loads and stores.)
|
||||||
|
unsigned Flags = MachineMemOperand::MOStore;
|
||||||
|
if (Opcode != ISD::ATOMIC_STORE || Ordering > Monotonic)
|
||||||
|
Flags |= MachineMemOperand::MOLoad;
|
||||||
|
|
||||||
// For now, atomics are considered to be volatile always.
|
// For now, atomics are considered to be volatile always.
|
||||||
|
// FIXME: Volatile isn't really correct; we should keep track of atomic
|
||||||
|
// orderings in the memoperand.
|
||||||
Flags |= MachineMemOperand::MOVolatile;
|
Flags |= MachineMemOperand::MOVolatile;
|
||||||
|
|
||||||
MachineMemOperand *MMO =
|
MachineMemOperand *MMO =
|
||||||
@ -3954,9 +3963,15 @@ SDValue SelectionDAG::getAtomic(unsigned Opcode, DebugLoc dl, EVT MemVT,
|
|||||||
Alignment = getEVTAlignment(MemVT);
|
Alignment = getEVTAlignment(MemVT);
|
||||||
|
|
||||||
MachineFunction &MF = getMachineFunction();
|
MachineFunction &MF = getMachineFunction();
|
||||||
unsigned Flags = MachineMemOperand::MOLoad | MachineMemOperand::MOStore;
|
// A monotonic load does not store; an acquire load "stores" in the sense
|
||||||
|
// that other loads cannot be hoisted past it.
|
||||||
|
unsigned Flags = MachineMemOperand::MOLoad;
|
||||||
|
if (Ordering > Monotonic)
|
||||||
|
Flags |= MachineMemOperand::MOStore;
|
||||||
|
|
||||||
// For now, atomics are considered to be volatile always.
|
// For now, atomics are considered to be volatile always.
|
||||||
|
// FIXME: Volatile isn't really correct; we should keep track of atomic
|
||||||
|
// orderings in the memoperand.
|
||||||
Flags |= MachineMemOperand::MOVolatile;
|
Flags |= MachineMemOperand::MOVolatile;
|
||||||
|
|
||||||
MachineMemOperand *MMO =
|
MachineMemOperand *MMO =
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -mtriple=armv7-apple-ios | FileCheck %s -check-prefix=ARM
|
; RUN: llc < %s -mtriple=armv7-apple-ios -verify-machineinstrs | FileCheck %s -check-prefix=ARM
|
||||||
; RUN: llc < %s -mtriple=armv7-apple-ios -O0 | FileCheck %s -check-prefix=ARM
|
; RUN: llc < %s -mtriple=armv7-apple-ios -O0 | FileCheck %s -check-prefix=ARM
|
||||||
; RUN: llc < %s -mtriple=thumbv7-apple-ios | FileCheck %s -check-prefix=THUMBTWO
|
; RUN: llc < %s -mtriple=thumbv7-apple-ios | FileCheck %s -check-prefix=THUMBTWO
|
||||||
; RUN: llc < %s -mtriple=thumbv6-apple-ios | FileCheck %s -check-prefix=THUMBONE
|
; RUN: llc < %s -mtriple=thumbv6-apple-ios | FileCheck %s -check-prefix=THUMBONE
|
||||||
|
Loading…
Reference in New Issue
Block a user