[llvm] [AMDGPU] Fix GCNRewritePartialRegUses pass: vector regclass is selected instead of scalar. (PR #69957)
Carl Ritson via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 00:03:22 PST 2023
================
@@ -425,29 +414,41 @@ bool GCNRewritePartialRegUses::rewriteReg(Register Reg) const {
return false;
for (MachineOperand &MO : Range) {
- if (MO.getSubReg() == AMDGPU::NoSubRegister) // Whole reg used, quit.
+ if (MO.getSubReg() == AMDGPU::NoSubRegister) // Whole reg used, quit. [1]
return false;
}
auto *RC = MRI->getRegClass(Reg);
LLVM_DEBUG(dbgs() << "Try to rewrite partial reg " << printReg(Reg, TRI)
<< ':' << TRI->getRegClassName(RC) << '\n');
- // Collect used subregs and constrained reg classes infered from instruction
+ // Collect used subregs and their reg classes infered from instruction
// operands.
SubRegMap SubRegs;
for (MachineOperand &MO : MRI->reg_nodbg_operands(Reg)) {
----------------
perlfu wrote:
Not sure why this is not `Range`?
https://github.com/llvm/llvm-project/pull/69957
More information about the llvm-commits
mailing list