mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
[mips] Use range-based for
loops. NFC
llvm-svn: 360817
This commit is contained in:
parent
4fdc3d2e09
commit
ff2428283a
@ -492,14 +492,12 @@ MemDefsUses::MemDefsUses(const DataLayout &DL, const MachineFrameInfo *MFI_)
|
||||
|
||||
bool MemDefsUses::hasHazard_(const MachineInstr &MI) {
|
||||
bool HasHazard = false;
|
||||
SmallVector<ValueType, 4> Objs;
|
||||
|
||||
// Check underlying object list.
|
||||
SmallVector<ValueType, 4> Objs;
|
||||
if (getUnderlyingObjects(MI, Objs)) {
|
||||
for (SmallVectorImpl<ValueType>::const_iterator I = Objs.begin();
|
||||
I != Objs.end(); ++I)
|
||||
HasHazard |= updateDefsUses(*I, MI.mayStore());
|
||||
|
||||
for (ValueType VT : Objs)
|
||||
HasHazard |= updateDefsUses(VT, MI.mayStore());
|
||||
return HasHazard;
|
||||
}
|
||||
|
||||
@ -525,33 +523,32 @@ bool MemDefsUses::updateDefsUses(ValueType V, bool MayStore) {
|
||||
bool MemDefsUses::
|
||||
getUnderlyingObjects(const MachineInstr &MI,
|
||||
SmallVectorImpl<ValueType> &Objects) const {
|
||||
if (!MI.hasOneMemOperand() ||
|
||||
(!(*MI.memoperands_begin())->getValue() &&
|
||||
!(*MI.memoperands_begin())->getPseudoValue()))
|
||||
if (!MI.hasOneMemOperand())
|
||||
return false;
|
||||
|
||||
if (const PseudoSourceValue *PSV =
|
||||
(*MI.memoperands_begin())->getPseudoValue()) {
|
||||
auto & MMO = **MI.memoperands_begin();
|
||||
|
||||
if (const PseudoSourceValue *PSV = MMO.getPseudoValue()) {
|
||||
if (!PSV->isAliased(MFI))
|
||||
return false;
|
||||
Objects.push_back(PSV);
|
||||
return true;
|
||||
}
|
||||
|
||||
const Value *V = (*MI.memoperands_begin())->getValue();
|
||||
if (const Value *V = MMO.getValue()) {
|
||||
SmallVector<const Value *, 4> Objs;
|
||||
GetUnderlyingObjects(V, Objs, DL);
|
||||
|
||||
SmallVector<const Value *, 4> Objs;
|
||||
GetUnderlyingObjects(V, Objs, DL);
|
||||
for (const Value *UValue : Objs) {
|
||||
if (!isIdentifiedObject(V))
|
||||
return false;
|
||||
|
||||
for (SmallVectorImpl<const Value *>::iterator I = Objs.begin(), E = Objs.end();
|
||||
I != E; ++I) {
|
||||
if (!isIdentifiedObject(V))
|
||||
return false;
|
||||
|
||||
Objects.push_back(*I);
|
||||
Objects.push_back(UValue);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Replace Branch with the compact branch instruction.
|
||||
|
Loading…
Reference in New Issue
Block a user