[PATCH] D95266: [AMDGPU] Fix FP materialization/resolve with flat scratch

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 14:06:20 PST 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:443
+    // an SGPR for flat scratch.
+    MRI.setRegClass(BaseReg, &AMDGPU::SReg_32_XEXEC_HIRegClass);
+  }
----------------
rampitec wrote:
> arsenm wrote:
> > I don't think you can blindly set the register class, you should contrainRegClass instead
> I cannot constrain VGPR to SGPR.
Oh, I see the API for this is just stupid. materializeFrameBaseRegister should just return the register it wants with the appropriate class. There's only the one caller, and there's no reason to have a randomly selected register class register as the input.


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

https://reviews.llvm.org/D95266



More information about the llvm-commits mailing list