[PATCH] D36171: AMDGPU: Use direct struct returns

Brian Sumner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 14:46:19 PDT 2017


b-sumner added inline comments.


================
Comment at: lib/CodeGen/TargetInfo.cpp:7571
+
+      // XXX: Should this be i64 instead, and should the limit increase?
+      llvm::Type *I32Ty = llvm::Type::getInt32Ty(getVMContext());
----------------
arsenm wrote:
> b-sumner wrote:
> > What we do here depends on NumRegsLeft when the block is entered and NumRegs.  If NumRegsLeft >= NumRegs then we just need 2 adjacent registers.  If NumRegsLeft == 1 and NumRegs == 2, then do we pass the low half in a register and the upper half in memory, or all of it in memory?  Anyway, I think NumRegsLeft shouldn't be updated until we know it's OK, and then we don't need the min().
> It's all one or the other. Whether it's passed in memory or not is really determined in codegen based on the actual register limit (which is also higher than the 16 used here, at least for now). Here selects whether to use byval or not. The ABI is slightly different whether it's passed as byval or as too many registers. I'm not sure it ever really makes sense to use byval yet, so I wasn't trying to be very precise here.
Thanks.  Just one more question.  If we use memory for an argument, are all following arguments required to use memory?  In that case, the min() is correct.  But if a following argument could use a register, then the amount to subtract is NumRegs <= NumRegsLeft ? NumRegs : 0.


https://reviews.llvm.org/D36171





More information about the cfe-commits mailing list