summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2017-04-20 11:42:27 -0700
committerAndres Gomez <agomez@igalia.com>2017-04-26 12:34:24 +0300
commit4c2356f13cb199dad474d38fecd424d200e4cffd (patch)
treebe9bd83f4e0baee0a798fa74059408fbd0c76275
parenta7c86ab750bc7e712068ac32ce83ad81c0b21bf8 (diff)
intel/fs: Take into account amount of data read in spilling cost heuristic.
Until now the spilling cost calculation was neglecting the amount of data read from the register during the spilling cost calculation. This caused it to make suboptimal decisions in some cases leading to higher memory bandwidth usage than necessary. Improves Unigine Heaven performance by ~4% on BDW, reversing an unintended FPS regression from my previous commit 147e71242ce539ff28e282f009c332818c35f5ac with n=12 and statistical significance 5%. In addition SynMark2 OglCSDof performance is improved by an additional ~5% on SKL, and a Kerbal Space Program apitrace around the Moho planet I can provide on request improves by ~20%. 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 58324389be7bc7c5e10093b9cc0a8efa9b4c93a9) [Andres Gomez: resolve trivial conflicts] Signed-off-by: Andres Gomez <agomez@igalia.com> Conflicts: src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp2
1 files changed, 1 insertions, 1 deletions
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 6ede65a1f59..12a39acebef 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -822,7 +822,7 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
foreach_block_and_inst(block, fs_inst, inst, cfg) {
for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == VGRF)
- spill_costs[inst->src[i].nr] += loop_scale;
+ spill_costs[inst->src[i].nr] += regs_read(inst, i) * loop_scale;
}
if (inst->dst.file == VGRF)