nak: Bias RA to find clear spaces for vector dests
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Try to find a space where the entire vec will fit when allocating one of
its components.

Totals:
CodeSize: 5750619392 -> 5654953920 (-1.66%); split: -1.75%, +0.09%
Static cycle count: 1497053946 -> 1493196467 (-0.26%); split: -0.43%, +0.18%

Totals from 163626 (83.27% of 196502) affected shaders:
CodeSize: 5498993328 -> 5403327856 (-1.74%); split: -1.83%, +0.09%
Static cycle count: 1423951803 -> 1420094324 (-0.27%); split: -0.46%, +0.19%

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35033>
This commit is contained in:
Mel Henning 2025-05-06 12:24:21 -04:00 committed by Marge Bot
parent a24a001209
commit 61d9911bba

View file

@ -459,10 +459,12 @@ impl RegAllocator {
}
// We weren't able to pair it with an already allocated
// register but maybe we can at least find an aligned one.
if let Some(reg) =
self.try_find_unused_reg_range(0, 1, align, 0)
// register but maybe we can at least find a place the vec
// would fit
if let Some(base_reg) =
self.try_find_unused_reg_range(0, vec.comps(), align, 0)
{
let reg = base_reg + u32::from(comp);
self.assign_reg(ssa, reg);
return reg;
}