From: Matt Turner Date: Mon, 14 Apr 2014 18:17:13 +0000 (-0700) Subject: i965/fs: Clear variable from live-set if it's completely overwritten. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18d12336b964cad54bbc0780380c3dcf625abb3d;p=mesa.git 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 --- 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];