mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
ir3/ra: Consider reg file size when swapping killed sources
Don't swap a 2-component vector of half-regs with a full reg if that
would result in the half regs going outside of the allowable half-reg
space.
Fixes: d4b5d2a020 ("ir3/ra: Use killed sources in register eviction")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13818>
This commit is contained in:
parent
f9a46ad22a
commit
9d88b98b08
1 changed files with 7 additions and 1 deletions
|
|
@ -780,10 +780,12 @@ try_evict_regs(struct ra_ctx *ctx, struct ra_file *file,
|
|||
return false;
|
||||
}
|
||||
|
||||
unsigned conflicting_file_size =
|
||||
reg_file_size(file, conflicting->interval.reg);
|
||||
unsigned avail_start, avail_end;
|
||||
bool evicted = false;
|
||||
BITSET_FOREACH_RANGE (avail_start, avail_end, available_to_evict,
|
||||
reg_file_size(file, conflicting->interval.reg)) {
|
||||
conflicting_file_size) {
|
||||
unsigned size = avail_end - avail_start;
|
||||
|
||||
/* non-half registers must be aligned */
|
||||
|
|
@ -820,6 +822,10 @@ try_evict_regs(struct ra_ctx *ctx, struct ra_file *file,
|
|||
conflicting->physreg_end - conflicting->physreg_start)
|
||||
continue;
|
||||
|
||||
if (killed->physreg_end > conflicting_file_size ||
|
||||
conflicting->physreg_end > reg_file_size(file, killed->interval.reg))
|
||||
continue;
|
||||
|
||||
/* We can't swap the killed range if it partially/fully overlaps the
|
||||
* space we're trying to allocate or (in speculative mode) if it's
|
||||
* already been swapped and will overlap when we actually evict.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue