[PATCH] D65471: [AMDGPU] Reserve all AGPRs on targets which do not have them

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 12:18:04 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/trunk/lib/Target/AMDGPU/SIRegisterInfo.cpp:223
 
+  // Reserve all the rest AGPRs if there are no instructions to use it.
+  if (!ST.hasMAIInsts()) {
----------------
rampitec wrote:
> arsenm wrote:
> > Do we really need to do this? If there are no AGPRs, no AGPRs virtual registers should be created for this to come up
> It is just a safety net. Somebody can use an inline asm with agprs (and sometimes do).
This would need a deliberate attempt to diagnose it. This won't stop you from using AGPRs since it still won't stop you from using physical AGPRs. I think this would just break regalloc in an unpredicatable way.

These loops over all registers aren't exactly cheap either, and getReservedRegs is called a few too many times. This should probably be removed


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65471/new/

https://reviews.llvm.org/D65471



More information about the llvm-commits mailing list