[PATCH] D121914: [AMDGPU] Stop using getMinimalPhysRegClass in LowerFormalArguments

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 08:14:24 PDT 2022


foad added a comment.

In D121914#3389338 <https://reviews.llvm.org/D121914#3389338>, @Joe_Nash wrote:

> I think a switch case over known RegClasses that we want to use is the way to go.

Do you prefer this (cribbed from SITargetLowering::insertCopiesSplitCSR)?

  const TargetRegisterClass *RC = nullptr;
  if (AMDGPU::SGPR_32RegClass.contains(Reg))
    RC = &AMDGPU::SGPR_32RegClass;
  else if (AMDGPU::VGPR_32RegClass.contains(Reg))
    RC = &AMDGPU::VGPR_32RegClass;
  else
    llvm_unreachable("Unexpected register class in LowerFormalArguments!");


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121914



More information about the llvm-commits mailing list