diff options
author | Kazu Hirata <kazu@google.com> | 2024-06-27 11:00:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 11:00:27 -0700 |
commit | 559ea40d9a12b0027cd7dbd955da31c06e6369f8 (patch) | |
tree | 5f7c3184f57114f79a80e4ab36c22a1e6aea69ca /llvm/lib/CodeGen/RegAllocBasic.cpp | |
parent | f55bcc5dbed9de21864e92cd2e6040bb00e6122c (diff) | |
download | llvm-559ea40d9a12b0027cd7dbd955da31c06e6369f8.zip llvm-559ea40d9a12b0027cd7dbd955da31c06e6369f8.tar.gz llvm-559ea40d9a12b0027cd7dbd955da31c06e6369f8.tar.bz2 |
[CodeGen] Use range-based for loops (NFC) (#96855)
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBasic.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocBasic.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/RegAllocBasic.cpp b/llvm/lib/CodeGen/RegAllocBasic.cpp index 5d84e1e..f465c63 100644 --- a/llvm/lib/CodeGen/RegAllocBasic.cpp +++ b/llvm/lib/CodeGen/RegAllocBasic.cpp @@ -226,19 +226,17 @@ bool RABasic::spillInterferences(const LiveInterval &VirtReg, assert(!Intfs.empty() && "expected interference"); // Spill each interfering vreg allocated to PhysReg or an alias. - for (unsigned i = 0, e = Intfs.size(); i != e; ++i) { - const LiveInterval &Spill = *Intfs[i]; - + for (const LiveInterval *Spill : Intfs) { // Skip duplicates. - if (!VRM->hasPhys(Spill.reg())) + if (!VRM->hasPhys(Spill->reg())) continue; // Deallocate the interfering vreg by removing it from the union. // A LiveInterval instance may not be in a union during modification! - Matrix->unassign(Spill); + Matrix->unassign(*Spill); // Spill the extracted interval. - LiveRangeEdit LRE(&Spill, SplitVRegs, *MF, *LIS, VRM, this, &DeadRemats); + LiveRangeEdit LRE(Spill, SplitVRegs, *MF, *LIS, VRM, this, &DeadRemats); spiller().spill(LRE); } return true; |