1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

ExecutionDomainFix.cpp - use const refs in for-range loops. NFCI.

Avoid unnecessary copies. Reported by clang-tidy.
This commit is contained in:
Simon Pilgrim 2021-01-27 15:21:26 +00:00
parent bd3db94c3e
commit b96bc31852

View File

@ -380,7 +380,7 @@ void ExecutionDomainFix::visitSoftInstr(MachineInstr *mi, unsigned mask) {
// Finally set all defs and non-collapsed uses to dv. We must iterate through // Finally set all defs and non-collapsed uses to dv. We must iterate through
// all the operators, including imp-def ones. // all the operators, including imp-def ones.
for (MachineOperand &mo : mi->operands()) { for (const MachineOperand &mo : mi->operands()) {
if (!mo.isReg()) if (!mo.isReg())
continue; continue;
for (int rx : regIndices(mo.getReg())) { for (int rx : regIndices(mo.getReg())) {
@ -454,16 +454,14 @@ bool ExecutionDomainFix::runOnMachineFunction(MachineFunction &mf) {
// Traverse the basic blocks. // Traverse the basic blocks.
LoopTraversal Traversal; LoopTraversal Traversal;
LoopTraversal::TraversalOrder TraversedMBBOrder = Traversal.traverse(mf); LoopTraversal::TraversalOrder TraversedMBBOrder = Traversal.traverse(mf);
for (LoopTraversal::TraversedMBBInfo TraversedMBB : TraversedMBBOrder) { for (const LoopTraversal::TraversedMBBInfo &TraversedMBB : TraversedMBBOrder)
processBasicBlock(TraversedMBB); processBasicBlock(TraversedMBB);
}
for (LiveRegsDVInfo OutLiveRegs : MBBOutRegsInfos) { for (const LiveRegsDVInfo &OutLiveRegs : MBBOutRegsInfos)
for (DomainValue *OutLiveReg : OutLiveRegs) { for (DomainValue *OutLiveReg : OutLiveRegs)
if (OutLiveReg) if (OutLiveReg)
release(OutLiveReg); release(OutLiveReg);
}
}
MBBOutRegsInfos.clear(); MBBOutRegsInfos.clear();
Avail.clear(); Avail.clear();
Allocator.DestroyAll(); Allocator.DestroyAll();