[PATCH] D157719: [AMDGPU] [SIFrameLowering] Replace LivePhysRegs with LiveRegUnits
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 13:33:32 PDT 2023
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:34-37
for (MCRegister Reg : RC) {
- if (!MRI.isPhysRegUsed(Reg) && LiveRegs.available(MRI, Reg))
+ if (!MRI.isPhysRegUsed(Reg) && LiveUnits.available(MRI, Reg))
return Reg;
}
----------------
tanejapranav wrote:
> arsenm wrote:
> > The isPhysRegUsed check should be redundant
> >
> > This loop seems backwards, we could start by finding unused regunits and go up to the the register
> The utility for finding the used physical registers in a function is already available by querying the alias register set. However, in the case of Register Units, appears like we don't have one ready in the LiveRegUnits implementation that would help us track the used Register Units.
>
> At this point, we may have to compute the information on used register units which would require iterating over all instructions in the function, further worsening the complexity. Would it be worth going in that direction.
>
Ideally UsedPhysRegMask would use register units and be up-to-date by this point
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157719/new/
https://reviews.llvm.org/D157719
More information about the llvm-commits
mailing list