[llvm] [AMDGPU] Allocate i1 argument to SGPRs (PR #72461)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 29 01:39:54 PST 2024
================
@@ -715,6 +715,14 @@ bool SILowerI1Copies::lowerCopiesToI1() {
assert(!MI.getOperand(1).getSubReg());
if (!SrcReg.isVirtual() || (!isLaneMaskReg(SrcReg) && !isVreg1(SrcReg))) {
+ if (!SrcReg.isVirtual() &&
+ TII->getRegisterInfo().getRegSizeInBits(SrcReg, *MRI) == 64) {
+ // When calling convention allocates SGPR for i1, for GPUs with
+ // wavefront size 64, i1 return value is put in 64b SGPR.
+ assert(ST->isWave64());
+ continue;
+ }
+
----------------
arsenm wrote:
The virtual register copies are getting emitted backwards, yes.
You could hack around this in LowerFormalArguments by manually copying to a virtual register with the correct class, and then emitting a copy from that virtual register.
https://github.com/llvm/llvm-project/pull/72461
More information about the llvm-commits
mailing list