[PATCH] D123651: [AMDGPU][NFC] Organize code around reserving VGPR32 for AGPR copy.
Mahesha S via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 13 01:40:24 PDT 2022
hsmhsm marked 2 inline comments as done.
hsmhsm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:702
+ auto reservedVGPR =
+ const_cast<SIMachineFunctionInfo *>(MFI)->reserveVGPRForAGPRCopy(
+ MaxNumVGPRs - 1);
----------------
cdevadas wrote:
> I don't think it's the right place to reserve the VGPR by changing the constness of MFI.
> May be finalizeLowering?
Actually, it may not work in case of mir lit tests which may not call finalizeLowering(), but may call getReservedRegs().
Nevertheless it is not a good idea to remove constness and mutate const object. For now, since it an NFC patch, and which actually just refactor the code around reserving VGPR for AGPR copy, let me not add code to mutate const object.
And, in the next subsequent patch, let me think if we can handle it better.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123651/new/
https://reviews.llvm.org/D123651
More information about the llvm-commits
mailing list