[PATCH] D78311: [AMDGPU] New helper functions to get a register class of a given width

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 02:07:52 PDT 2020


foad marked 5 inline comments as done.
foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:1304
+static const TargetRegisterClass *
+getAGPRClassForBitWidth(unsigned BitWidth) {
+  switch (BitWidth) {
----------------
arsenm wrote:
> This should probably include the full set of sizes to avoid weird legalization problems, but I guess some are already missing
I've done this as D78348.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:1415
 const TargetRegisterClass *SIRegisterInfo::getEquivalentVGPRClass(
                                          const TargetRegisterClass *SRC) const {
+  unsigned Size = getRegSizeInBits(*SRC);
----------------
arsenm wrote:
> This could really be a static method
It's not trivial because getRegSizeInBits is non-static.


================
Comment at: llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp:1430
 
 const TargetRegisterClass *SIRegisterInfo::getEquivalentSGPRClass(
                                          const TargetRegisterClass *VRC) const {
----------------
arsenm wrote:
> Can be static method
Likewise.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78311





More information about the llvm-commits mailing list