[PATCH] D98515: [AMDGPU][GlobalISel] Stop foldInsertEltToCmpSelect from changing reg banks
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 6 18:05:35 PDT 2021
arsenm requested changes to this revision.
arsenm added inline comments.
This revision now requires changes to proceed.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:2002
+ Register InReg = MI.getOperand(2).getReg();
+ if (DstBank == AMDGPU::VGPRRegBank && InsBank == AMDGPU::SGPRRegBank)
+ InReg = B.buildCopy(MRI.getType(InReg), InReg).getReg(0);
----------------
OK I see what's happening now. I think this should introduce a new utility function to try to constrain a register to a register bank, or insert a copy if not (similar to the existing ones for concrete register classes). This should also be called below in place of the setRegBank where this is overwritten
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98515/new/
https://reviews.llvm.org/D98515
More information about the llvm-commits
mailing list