Skip to content

Commit 721adc1

Browse files
authored
[CodeGen] Fix stale comment about register coalescing order (#146762)
The register coalescer collects the copies forward, the stale comment wasn't addressed back then by: tomershafir@75961ec. This change updates the coment and also adds a similar one to the other branch.
1 parent a5af874 commit 721adc1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/CodeGen/RegisterCoalescer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,10 +4152,8 @@ void RegisterCoalescer::copyCoalesceInMBB(MachineBasicBlock *MBB) {
41524152
if (JoinGlobalCopies) {
41534153
SmallVector<MachineInstr *, 2> LocalTerminals;
41544154
SmallVector<MachineInstr *, 2> GlobalTerminals;
4155-
// Coalesce copies bottom-up to coalesce local defs before local uses. They
4156-
// are not inherently easier to resolve, but slightly preferable until we
4157-
// have local live range splitting. In particular this is required by
4158-
// cmp+jmp macro fusion.
4155+
// Coalesce copies top-down to propagate coalescing and rematerialization
4156+
// forward.
41594157
for (MachineInstr &MI : *MBB) {
41604158
if (!MI.isCopyLike())
41614159
continue;
@@ -4177,6 +4175,8 @@ void RegisterCoalescer::copyCoalesceInMBB(MachineBasicBlock *MBB) {
41774175
WorkList.append(GlobalTerminals.begin(), GlobalTerminals.end());
41784176
} else {
41794177
SmallVector<MachineInstr *, 2> Terminals;
4178+
// Coalesce copies top-down to propagate coalescing and rematerialization
4179+
// forward.
41804180
for (MachineInstr &MII : *MBB)
41814181
if (MII.isCopyLike()) {
41824182
if (applyTerminalRule(MII))

0 commit comments

Comments
 (0)