agx: Try to allocate phis compatibly with sources
All shaders affected for thread count are in pubg... by chance the allocation before used fewer registers than the calculated register demand (I guess because we're conservative with our vector handling) and so got lucky and got higher thread count. That shader is also helped massively for instructions. The halfreg change doesn't matter -- we're not actually increasing register demand, we're just being more choosy about our registers. total instructions in shared programs: 1799738 -> 1790901 (-0.49%) instructions in affected programs: 306081 -> 297244 (-2.89%) helped: 889 HURT: 14 Instructions are helped. total bytes in shared programs: 12263290 -> 12210266 (-0.43%) bytes in affected programs: 2150966 -> 2097942 (-2.47%) helped: 889 HURT: 14 Bytes are helped. total halfregs in shared programs: 531981 -> 532130 (0.03%) halfregs in affected programs: 1925 -> 2074 (7.74%) helped: 0 HURT: 26 Halfregs are HURT. total threads in shared programs: 18885184 -> 18884224 (<.01%) threads in affected programs: 13440 -> 12480 (-7.14%) helped: 0 HURT: 15 Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24258>
This commit is contained in:
committed by
Marge Bot
parent
6cc8d7b52a
commit
73da872a66
@@ -769,6 +769,18 @@ pick_regs(struct ra_ctx *rctx, agx_instr *I, unsigned d)
|
||||
|
||||
unsigned align = count;
|
||||
|
||||
/* Try to allocate phis compatibly with their sources */
|
||||
if (I->op == AGX_OPCODE_PHI) {
|
||||
agx_foreach_ssa_src(I, s) {
|
||||
/* Loop headers have phis with a source preceding the definition */
|
||||
bool may_be_unvisited = rctx->block->loop_header;
|
||||
|
||||
unsigned out;
|
||||
if (try_coalesce_with(rctx, I->src[s], count, may_be_unvisited, &out))
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to allocate collects compatibly with their sources */
|
||||
if (I->op == AGX_OPCODE_COLLECT) {
|
||||
agx_foreach_ssa_src(I, s) {
|
||||
|
||||
Reference in New Issue
Block a user