aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/RegisterCoalescer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/RegisterCoalescer.cpp')
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index c847068bca90..4c8534cf2d01 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -3908,20 +3908,20 @@ void RegisterCoalescer::lateLiveIntervalUpdate() {
bool RegisterCoalescer::
copyCoalesceWorkList(MutableArrayRef<MachineInstr*> CurrList) {
bool Progress = false;
- for (unsigned i = 0, e = CurrList.size(); i != e; ++i) {
- if (!CurrList[i])
+ for (MachineInstr *&MI : CurrList) {
+ if (!MI)
continue;
// Skip instruction pointers that have already been erased, for example by
// dead code elimination.
- if (ErasedInstrs.count(CurrList[i])) {
- CurrList[i] = nullptr;
+ if (ErasedInstrs.count(MI)) {
+ MI = nullptr;
continue;
}
bool Again = false;
- bool Success = joinCopy(CurrList[i], Again);
+ bool Success = joinCopy(MI, Again);
Progress |= Success;
if (Success || !Again)
- CurrList[i] = nullptr;
+ MI = nullptr;
}
return Progress;
}