[llvm-branch-commits] [llvm] AMDGPU/GlobalISel: AMDGPURegBankLegalize (PR #112864)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Dec 4 16:41:24 PST 2024
================
@@ -674,6 +674,14 @@ class MachineRegisterInfo {
return dyn_cast_if_present<const TargetRegisterClass *>(Val);
}
+ /// Return the register bank of \p Reg.
+ /// This shouldn't be used directly unless \p Reg has a register bank.
+ const RegisterBank *getRegBank(Register Reg) const {
+ assert(isa<const RegisterBank *>(VRegInfo[Reg.id()].first) &&
+ "Register bank not set, wrong accessor");
----------------
arsenm wrote:
Assert redundant with the `cast<>`
https://github.com/llvm/llvm-project/pull/112864
More information about the llvm-branch-commits
mailing list