The register pressure analysis I wrote in 2013 only considered VGRFs,
and not other GRFs, such as payload registers and push constants. We
need to consider those too, because payload registers definitely occupy
space and add to pressure.
In 2015, Connor already made the scheduler account for this, so the only
real use for this is in shader statistic dumps and optimizer printouts.
But we should make it more accurate. (We will use it in more places
shortly, a few commits from now.)
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24707>
for (int ip = live.vgrf_start[reg]; ip <= live.vgrf_end[reg]; ip++)
regs_live_at_ip[ip] += v->alloc.sizes[reg];
}
+
+ const unsigned payload_count = v->first_non_payload_grf;
+
+ int *payload_last_use_ip = new int[payload_count];
+ v->calculate_payload_ranges(payload_count, payload_last_use_ip);
+
+ for (unsigned reg = 0; reg < payload_count; reg++) {
+ for (int ip = 0; ip < payload_last_use_ip[reg]; ip++)
+ ++regs_live_at_ip[ip];
+ }
+
+ delete[] payload_last_use_ip;
}
brw::register_pressure::~register_pressure()