[PATCH] D120813: AMDGPU: Skip folding REG_SEQUENCE if found unknown regclasses for its users.
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 4 06:21:22 PST 2022
foad added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:1602
unsigned OpIdx = Op - &UseMI->getOperand(0);
+ if (TII->isUnknownRegClass(*UseMI, OpIdx))
+ return false;
----------------
cdevadas wrote:
> foad wrote:
> > You could just use TargetInstrInfo::getRegClass(InstDesc, OpIdx, TRI, MF) instead of TRI->getRegClass and it would do all these checks for you already.
> We can't use that equivalent of `getRegClass` here. The call to `adjustAllocatableRegClass` inside it would change AV classes to V thereby disabling the folding in almost all valid cases.
>
The call to `adjustAllocatableRegClass` is in the AMDGPU-specific getOpRegClass, not in the generic getRegClass.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120813/new/
https://reviews.llvm.org/D120813
More information about the llvm-commits
mailing list