summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2017-04-20 11:44:01 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2017-04-30 09:46:29 +0100
commitba6fd491a18695e72b467689d605ecd84419f40f (patch)
treed122e79faed18e0538123d46e645fdeb30284312
parent36f6fc59cb4b61b1128a961d8808428257849adc (diff)
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 ecc19e12dca95d2571d3761dea6dec24b061013c)
-rw-r--r--src/intel/compiler/brw_fs_reg_allocate.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp
index c981d72e4f2..2d4d46ef334 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) {