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

Francisco Jerez currojerez at kemper.freedesktop.org
Mon Apr 24 18:06:59 UTC 2017


Module: Mesa
Branch: master
Commit: ecc19e12dca95d2571d3761dea6dec24b061013c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ecc19e12dca95d2571d3761dea6dec24b061013c

Author: Francisco Jerez <currojerez at riseup.net>
Date:   Thu Apr 20 11:44:01 2017 -0700

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 at lists.freedesktop.org>
Reviewed-by: Plamena Manolova <plamena.manolova at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/compiler/brw_fs_reg_allocate.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp
index c981d72e4f..2d4d46ef33 100644
--- a/src/intel/compiler/brw_fs_reg_allocate.cpp
+++ b/src/intel/compiler/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)
-                                      * block_scale;
+         spill_costs[inst->dst.nr] += regs_written(inst) * block_scale;
 
       switch (inst->opcode) {
 




More information about the mesa-commit mailing list