Skip to content

Commit 9d7952f

Browse files
committed
address comments
1 parent d4fbb7d commit 9d7952f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Target/AMDGPU/AMDGPUMarkLastScratchLoad.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// Mark scratch load/spill instructions which are guaranteed to be the last time
1010
// this scratch slot is used so it can be evicted from caches.
1111
//
12+
// TODO: Handle general stack accesses not just spilling.
13+
//
1214
//===----------------------------------------------------------------------===//
1315

1416
#include "AMDGPU.h"
@@ -52,11 +54,6 @@ class AMDGPUMarkLastScratchLoad : public MachineFunctionPass {
5254
} // end anonymous namespace
5355

5456
bool AMDGPUMarkLastScratchLoad::runOnMachineFunction(MachineFunction &MF) {
55-
LLVM_DEBUG({
56-
dbgs() << "********** Mark Last Scratch Load **********\n"
57-
<< "********** Function: " << MF.getName() << '\n';
58-
});
59-
6057
if (skipFunction(MF.getFunction()))
6158
return false;
6259

@@ -101,7 +98,7 @@ bool AMDGPUMarkLastScratchLoad::runOnMachineFunction(MachineFunction &MF) {
10198

10299
// Start iteration backwards from segment end until the start of basic
103100
// block or start of segment if it is in the same basic block.
104-
auto End = BB->instr_rend();
101+
auto End = BB->rend();
105102
if (MISegmentStart && MISegmentStart->getParent() == BB)
106103
End = MISegmentStart->getReverseIterator();
107104

@@ -118,7 +115,7 @@ bool AMDGPUMarkLastScratchLoad::runOnMachineFunction(MachineFunction &MF) {
118115
MachineMemOperand *MMO = *LastLoad->memoperands_begin();
119116
MMO->setFlags(MOLastUse);
120117
Changed = true;
121-
LLVM_DEBUG(dbgs() << " Found last load: " << *LastLoad;);
118+
LLVM_DEBUG(dbgs() << " Found last load: " << *LastLoad);
122119
}
123120
}
124121
}

0 commit comments

Comments
 (0)