[PATCH] D154083: [AMDGPU] Rematerialize scalar loads
Piotr Sobczak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 10 00:51:42 PDT 2023
piotr marked 9 inline comments as done.
piotr added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:2354
+ MI->getOperand(0).setIsUndef(false);
+ MRI.setRegClass(DestReg, &AMDGPU::SGPR_256RegClass);
+
----------------
arsenm wrote:
> piotr wrote:
> > arsenm wrote:
> > > arsenm wrote:
> > > > Can you go through getSubRegisterClass (possibly with getMatchingSuperRegClass and getSubClassWithSubReg) to avoid hardcoding this
> > > Easier yet would be just use the result class from the instruction desc
> > >
> > > Also, is this safe from other users with a different class?
> > Thanks - will rewrite this, but what exactly do you mean here by "safe from other users"?
> I mean other instructions using the same virtual register that aren't expecting the class to change. You're mutating the existing register and not creating a new one with the new class
I'm mutating DestReg which does not have users. Adding the assertion, but maybe an early out would be more future-proof.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154083/new/
https://reviews.llvm.org/D154083
More information about the llvm-commits
mailing list