mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
[ScheduleDAGInstrs] isUnsafeMemoryObject() removed
This function was basically useless, since volatile memacesses or MIs with unmodelled sideffects become global memory objects, and the other little checks are also done elsewhere. Reviewed by Andy Trick http://reviews.llvm.org/D16881 llvm-svn: 260899
This commit is contained in:
parent
48b855efb1
commit
aa66c31e2b
@ -549,34 +549,6 @@ static inline bool isGlobalMemoryObject(AliasAnalysis *AA, MachineInstr *MI) {
|
||||
(MI->hasOrderedMemoryRef() && !MI->isInvariantLoad(AA));
|
||||
}
|
||||
|
||||
// This MI might have either incomplete info, or known to be unsafe
|
||||
// to deal with (i.e. volatile object).
|
||||
static inline bool isUnsafeMemoryObject(MachineInstr *MI,
|
||||
const MachineFrameInfo *MFI,
|
||||
const DataLayout &DL) {
|
||||
if (!MI || MI->memoperands_empty())
|
||||
return true;
|
||||
// We purposefully do no check for hasOneMemOperand() here
|
||||
// in hope to trigger an assert downstream in order to
|
||||
// finish implementation.
|
||||
if ((*MI->memoperands_begin())->isVolatile() ||
|
||||
MI->hasUnmodeledSideEffects())
|
||||
return true;
|
||||
|
||||
if ((*MI->memoperands_begin())->getPseudoValue()) {
|
||||
// Similarly to getUnderlyingObjectForInstr:
|
||||
// For now, ignore PseudoSourceValues which may alias LLVM IR values
|
||||
// because the code that uses this function has no way to cope with
|
||||
// such aliases.
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((*MI->memoperands_begin())->getValue() == nullptr)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// This returns true if the two MIs need a chain edge between them.
|
||||
/// This is called on normal stores and loads.
|
||||
static bool MIsNeedChainEdge(AliasAnalysis *AA, const MachineFrameInfo *MFI,
|
||||
@ -592,17 +564,14 @@ static bool MIsNeedChainEdge(AliasAnalysis *AA, const MachineFrameInfo *MFI,
|
||||
if (TII->areMemAccessesTriviallyDisjoint(MIa, MIb, AA))
|
||||
return false;
|
||||
|
||||
// FIXME: Need to handle multiple memory operands to support all targets.
|
||||
if (!MIa->hasOneMemOperand() || !MIb->hasOneMemOperand())
|
||||
return true;
|
||||
|
||||
if (isUnsafeMemoryObject(MIa, MFI, DL) || isUnsafeMemoryObject(MIb, MFI, DL))
|
||||
return true;
|
||||
|
||||
// To this point analysis is generic. From here on we do need AA.
|
||||
if (!AA)
|
||||
return true;
|
||||
|
||||
// FIXME: Need to handle multiple memory operands to support all targets.
|
||||
if (!MIa->hasOneMemOperand() || !MIb->hasOneMemOperand())
|
||||
return true;
|
||||
|
||||
MachineMemOperand *MMOa = *MIa->memoperands_begin();
|
||||
MachineMemOperand *MMOb = *MIb->memoperands_begin();
|
||||
|
||||
@ -1042,7 +1011,7 @@ void ScheduleDAGInstrs::buildSchedGraph(AliasAnalysis *AA,
|
||||
// Find the underlying objects for MI. The Objs vector is either
|
||||
// empty, or filled with the Values of memory locations which this
|
||||
// SU depends on. An empty vector means the memory location is
|
||||
// unknown, and may alias anything except NonAlias nodes.
|
||||
// unknown, and may alias anything.
|
||||
UnderlyingObjectsVector Objs;
|
||||
getUnderlyingObjectsForInstr(MI, MFI, Objs, MF.getDataLayout());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user