1
0
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:
Simon Atanasyan 2019-05-15 21:26:25 +00:00
parent 4fdc3d2e09
commit ff2428283a

View File

@ -492,14 +492,12 @@ MemDefsUses::MemDefsUses(const DataLayout &DL, const MachineFrameInfo *MFI_)
bool MemDefsUses::hasHazard_(const MachineInstr &MI) { bool MemDefsUses::hasHazard_(const MachineInstr &MI) {
bool HasHazard = false; bool HasHazard = false;
SmallVector<ValueType, 4> Objs;
// Check underlying object list. // Check underlying object list.
SmallVector<ValueType, 4> Objs;
if (getUnderlyingObjects(MI, Objs)) { if (getUnderlyingObjects(MI, Objs)) {
for (SmallVectorImpl<ValueType>::const_iterator I = Objs.begin(); for (ValueType VT : Objs)
I != Objs.end(); ++I) HasHazard |= updateDefsUses(VT, MI.mayStore());
HasHazard |= updateDefsUses(*I, MI.mayStore());
return HasHazard; return HasHazard;
} }
@ -525,33 +523,32 @@ bool MemDefsUses::updateDefsUses(ValueType V, bool MayStore) {
bool MemDefsUses:: bool MemDefsUses::
getUnderlyingObjects(const MachineInstr &MI, getUnderlyingObjects(const MachineInstr &MI,
SmallVectorImpl<ValueType> &Objects) const { SmallVectorImpl<ValueType> &Objects) const {
if (!MI.hasOneMemOperand() || if (!MI.hasOneMemOperand())
(!(*MI.memoperands_begin())->getValue() &&
!(*MI.memoperands_begin())->getPseudoValue()))
return false; return false;
if (const PseudoSourceValue *PSV = auto & MMO = **MI.memoperands_begin();
(*MI.memoperands_begin())->getPseudoValue()) {
if (const PseudoSourceValue *PSV = MMO.getPseudoValue()) {
if (!PSV->isAliased(MFI)) if (!PSV->isAliased(MFI))
return false; return false;
Objects.push_back(PSV); Objects.push_back(PSV);
return true; 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; for (const Value *UValue : Objs) {
GetUnderlyingObjects(V, Objs, DL); if (!isIdentifiedObject(V))
return false;
for (SmallVectorImpl<const Value *>::iterator I = Objs.begin(), E = Objs.end(); Objects.push_back(UValue);
I != E; ++I) { }
if (!isIdentifiedObject(V)) return true;
return false;
Objects.push_back(*I);
} }
return true; return false;
} }
// Replace Branch with the compact branch instruction. // Replace Branch with the compact branch instruction.