Skip to content

Commit f98735f

Browse files
authored
Greedy: Use initializer list for recoloring candidates (NFC) (#160486)
1 parent b92ff6b commit f98735f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/CodeGen/RegAllocGreedy.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,15 +2482,13 @@ void RAGreedy::tryHintRecoloring(const LiveInterval &VirtReg) {
24822482
// We have a broken hint, check if it is possible to fix it by
24832483
// reusing PhysReg for the copy-related live-ranges. Indeed, we evicted
24842484
// some register and PhysReg may be available for the other live-ranges.
2485-
SmallSet<Register, 4> Visited;
2486-
SmallVector<Register, 2> RecoloringCandidates;
24872485
HintsInfo Info;
24882486
Register Reg = VirtReg.reg();
24892487
MCRegister PhysReg = VRM->getPhys(Reg);
24902488
// Start the recoloring algorithm from the input live-interval, then
24912489
// it will propagate to the ones that are copy-related with it.
2492-
Visited.insert(Reg);
2493-
RecoloringCandidates.push_back(Reg);
2490+
SmallSet<Register, 4> Visited = {Reg};
2491+
SmallVector<Register, 2> RecoloringCandidates = {Reg};
24942492

24952493
LLVM_DEBUG(dbgs() << "Trying to reconcile hints for: " << printReg(Reg, TRI)
24962494
<< '(' << printReg(PhysReg, TRI) << ")\n");

0 commit comments

Comments
 (0)