Skip to content

Commit 4219e83

Browse files
committed
Made changes to get rid of generic changes & addressed the required changes in comments and test files.
1 parent e871e83 commit 4219e83

File tree

5 files changed

+255
-234
lines changed

5 files changed

+255
-234
lines changed

llvm/include/llvm/CodeGen/Passes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ namespace llvm {
283283
/// critical-path and resource depth.
284284
extern char &MachineCombinerID;
285285

286-
/// StackColoring - This pass performs stack coloring and merging.
286+
/// StackSlotColoring - This pass performs stack coloring and merging.
287287
/// It merges disjoint allocas to reduce the stack size.
288288
extern char &StackColoringID;
289289

llvm/lib/CodeGen/StackSlotColoring.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "llvm/ADT/BitVector.h"
1414
#include "llvm/ADT/SmallVector.h"
1515
#include "llvm/ADT/Statistic.h"
16-
#include "llvm/CodeGen/LiveDebugVariables.h"
1716
#include "llvm/CodeGen/LiveInterval.h"
1817
#include "llvm/CodeGen/LiveIntervalUnion.h"
1918
#include "llvm/CodeGen/LiveIntervals.h"

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,10 +1421,9 @@ bool GCNPassConfig::addRegAssignAndRewriteOptimized() {
14211421
// since FastRegAlloc does the replacements itself.
14221422
addPass(createVirtRegRewriter(false));
14231423

1424-
// As by this point SGPR's RA is done introducing SGPR spills to stack frame
1425-
// through SGPRAllocPass. So, invoking StackSlotColoring here, may allow these
1426-
// SGPR spills to re-use stack slots, before these spills is further lowered
1427-
// down via SILowerSGPRSpills(i.e. equivalent of PEI for SGPRs).
1424+
// At this point, the sgpr-regalloc has been done and it is good to have the
1425+
// stack slot coloring to try to optimize the SGPR spill stack indices before
1426+
// attempting the custom SGPR spill lowering.
14281427
addPass(&StackSlotColoringID);
14291428

14301429
// Equivalent of PEI for SGPRs.

llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,12 @@ void SILowerSGPRSpills::extendWWMVirtRegLiveness(MachineFunction &MF,
278278
for (auto Reg : MFI->getSGPRSpillVGPRs()) {
279279
for (MachineBasicBlock *SaveBlock : SaveBlocks) {
280280
MachineBasicBlock::iterator InsertBefore = SaveBlock->begin();
281-
282281
DebugLoc DL = SaveBlock->findDebugLoc(InsertBefore);
283282
auto MIB = BuildMI(*SaveBlock, InsertBefore, DL,
284283
TII->get(AMDGPU::IMPLICIT_DEF), Reg);
285284
MFI->setFlag(Reg, AMDGPU::VirtRegFlag::WWM_REG);
286285
// Set SGPR_SPILL asm printer flag
287286
MIB->setAsmPrinterFlag(AMDGPU::SGPR_SPILL);
288-
289287
if (LIS)
290288
LIS->InsertMachineInstrInMaps(*MIB);
291289
}
@@ -301,7 +299,6 @@ void SILowerSGPRSpills::extendWWMVirtRegLiveness(MachineFunction &MF,
301299
auto MIB = BuildMI(*RestoreBlock, InsertBefore, DL,
302300
TII->get(TargetOpcode::KILL));
303301
MIB.addReg(Reg);
304-
305302
if (LIS)
306303
LIS->InsertMachineInstrInMaps(*MIB);
307304
}

0 commit comments

Comments
 (0)