Skip to content

Commit 652e51c

Browse files
committed
Remove unwanted changes not needed in this PR, and refactored some comments.
1 parent 4219e83 commit 652e51c

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

llvm/lib/CodeGen/StackSlotColoring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,4 +559,4 @@ bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {
559559
Assignments.clear();
560560

561561
return Changed;
562-
}
562+
}

llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ void SILowerSGPRSpills::extendWWMVirtRegLiveness(MachineFunction &MF,
284284
MFI->setFlag(Reg, AMDGPU::VirtRegFlag::WWM_REG);
285285
// Set SGPR_SPILL asm printer flag
286286
MIB->setAsmPrinterFlag(AMDGPU::SGPR_SPILL);
287-
if (LIS)
287+
if (LIS) {
288288
LIS->InsertMachineInstrInMaps(*MIB);
289+
}
289290
}
290291
}
291292

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,10 +1775,13 @@ bool SIRegisterInfo::spillSGPR(MachineBasicBlock::iterator MI, int Index,
17751775

17761776
if (SpillToVGPR) {
17771777

1778+
// Since stack slot coloring pass is trying to optimize SGPR spills,
1779+
// VGPR lanes (mapped from spill stack slot) may be shared for unequal SGPR
1780+
// spills. This accounts for number of VGPR lanes alloted equal to the
1781+
// largest SGPR being spilled in them.
17781782
assert(SB.NumSubRegs <= VGPRSpills.size() &&
1779-
"Num of VGPR lanes should be greater or equal to num of SGPRs "
1780-
"spilled, as Stack Slot Coloring pass assigns different SGPR spills "
1781-
"into same stack slots");
1783+
"Num of VGPR lanes mapped should be greater or equal to num of "
1784+
"SGPRs spilled");
17821785

17831786
for (unsigned i = 0, e = SB.NumSubRegs; i < e; ++i) {
17841787
Register SubReg =

0 commit comments

Comments
 (0)