From a7c86ab750bc7e712068ac32ce83ad81c0b21bf8 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Thu, 20 Apr 2017 11:44:01 -0700 Subject: 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: Reviewed-by: Plamena Manolova Reviewed-by: Jason Ekstrand (cherry picked from commit ecc19e12dca95d2571d3761dea6dec24b061013c) [Andres Gomez: resolve trivial conflicts] Signed-off-by: Andres Gomez Conflicts: src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp --- src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp index 5c6f3d490f0..6ede65a1f59 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp @@ -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) { -- cgit v1.2.3