intel/fs: Use regs_written() in spilling cost heuristic for improved accuracy.

This is what we use later on to compute the number of registers that
will actually get spilled to memory, so it's more likely to match
reality than the current open-coded approximation.

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
(cherry picked from commit ecc19e12dc)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: Andres Gomez <agomez@igalia.com>

Conflicts:
	src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
This commit is contained in:
Francisco Jerez 2017-04-20 11:44:01 -07:00 committed by Andres Gomez
parent 5403c02983
commit a7c86ab750

View file

@ -826,8 +826,7 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
}
if (inst->dst.file == VGRF)
spill_costs[inst->dst.nr] += DIV_ROUND_UP(inst->size_written, REG_SIZE)
* loop_scale;
spill_costs[inst->dst.nr] += regs_written(inst) * loop_scale;
switch (inst->opcode) {