mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 09:30:11 +01:00
brw: Track the largest VGRF size in liveness analysis
We're already looking at this data to calculate the per-component
vars_from_vgrf[] and vgrf_from_vars[] mappings, so just record the
largest VGRF size while we're here. This will allow passes to size
arrays based on the actual size needed, rather than hardcoding some
fixed size. In many cases, MAX_VGRF_SIZE(devinfo) is larger than
necessary, because e.g. vec5 sparse sampling results aren't used.
Not hardcoding this means we can also temporarily handle very large
VGRFs which we know will be split eventually, without having to
increase the maximum which is ultimately used for RA classes.
Cc: mesa-stable
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34461>
(cherry picked from commit ea468412f6)
This commit is contained in:
parent
6c6c6873c4
commit
c906f565b6
3 changed files with 6 additions and 1 deletions
|
|
@ -1404,7 +1404,7 @@
|
|||
"description": "brw: Track the largest VGRF size in liveness analysis",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -254,10 +254,13 @@ fs_live_variables::fs_live_variables(const fs_visitor *s)
|
|||
|
||||
num_vgrfs = s->alloc.count;
|
||||
num_vars = 0;
|
||||
max_vgrf_size = 0;
|
||||
var_from_vgrf = linear_alloc_array(lin_ctx, int, num_vgrfs);
|
||||
for (int i = 0; i < num_vgrfs; i++) {
|
||||
var_from_vgrf[i] = num_vars;
|
||||
num_vars += s->alloc.sizes[i];
|
||||
|
||||
max_vgrf_size = MAX2(max_vgrf_size, s->alloc.sizes[i]);
|
||||
}
|
||||
|
||||
vgrf_from_var = linear_alloc_array(lin_ctx, int, num_vars);
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@ public:
|
|||
int num_vgrfs;
|
||||
int bitset_words;
|
||||
|
||||
unsigned max_vgrf_size;
|
||||
|
||||
/** @{
|
||||
* Final computed live ranges for each var (each component of each virtual
|
||||
* GRF).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue