From 18d12336b964cad54bbc0780380c3dcf625abb3d Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 14 Apr 2014 11:17:13 -0700 Subject: [PATCH] i965/fs: Clear variable from live-set if it's completely overwritten. One program affected: instructions in affected programs: 246 -> 244 (-0.81%) Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp index 390ac9ada5b..6672f840fc5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp @@ -85,6 +85,15 @@ fs_visitor::dead_code_eliminate() } } + if (inst->dst.file == GRF) { + if (!inst->is_partial_write()) { + int var = live_intervals->var_from_vgrf[inst->dst.reg]; + for (int i = 0; i < inst->regs_written; i++) { + BITSET_CLEAR(live, var + inst->dst.reg_offset + i); + } + } + } + for (int i = 0; i < 3; i++) { if (inst->src[i].file == GRF) { int var = live_intervals->var_from_vgrf[inst->src[i].reg]; -- 2.30.2