[PATCH] D102212: [AMDGPU] Add Optimize VGPR LiveRange Pass.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 8 03:36:57 PDT 2021
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp:158
+
+ if (Cur < Blocks.size())
+ MBB = Blocks[Cur++];
----------------
critson wrote:
> This doesn't seem right.
> You only collect an arbitrary number of blocks?
> Should ElseBlocks not simply be growing to hold all relevant blocks?
Cur tells you the first index in Blocks of a block that you have *not* already visited to scan its predecessors. Perhaps it would be clearer as:
```
SetVector<MachineBasicBlock *> Blocks(Endif);
for (unsigned Cur = 0; Cur < Blocks.size(); ++Cur) {
auto *MBB = Blocks[Cur];
for (auto *Pred : MBB->predecessors()) {
if (Pred != Flow)
Blocks.insert(Pred);
}
}
```
================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp:174
+ SmallVectorImpl<MachineInstr *> &Uses) const {
+ for (auto I = MRI->use_nodbg_begin(Reg), E = MRI->use_nodbg_end(); I != E;
+ ++I) {
----------------
`for (auto &UseMI : MRI->use_nodbg_instructions(Reg))`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102212/new/
https://reviews.llvm.org/D102212
More information about the llvm-commits
mailing list