This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 4/5] [amdgcn] Update lower limits requested by non-leaf kernels


On 15/11/2019 11:32 am, Andrew Stubbs wrote:
On 14/11/2019 15:33, Kwok Cheung Yeung wrote:
The kernel attributes are changed to request at least 64 SGPRs and 24 VGPRs (i.e. the non-kernel maximum, otherwise the callees may not have enough registers to run in) for non-leaf kernels to take advantage of the reduced number of registers used in non-kernel functions.

Okay for trunk?

I think you mean "leaf kernels" can use fewer registers. The code looks right.


No, I definitely mean non-leaf kernels here. Leaf kernels (i.e. kernels that don't call any other functions) can use as many or few registers as they want. Non-leaf kernels must abide by our implied ABI, which states that there are 64 SGPRs and 24 VPGRs available to non-kernel functions. Since the kernel has no way of knowing exactly how many registers are actually used by the functions it calls, it must assume the worst and reserve the whole 64 SGPRs/24 VGPRs, even if the kernel itself makes use of fewer registers. This is still a reduction over the previous 102 SGPRs/64 VGPRs.

Kwok


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]