AMDGPU: Correct getMaxNumSGPR treatment of flat_scratch
This was approximating the entry point logic for flat_scratch_init, which is not really the point. We need to account for whether we need to reserve the SGPR pair used for flat_scratch, not whether we needed the initialization kernel argument. If this was an arbitrary function, we would end up over-reporting the number of potentially free SGPRs. The logic for architected flat scratch also only applies to the initialization in the kernel, not the reserved registers at the end. Avoids compile failures in a future patch from allocating more SGPRs than the subtarget supports.
Loading
Please sign in to comment