diff options
author | Matt Turner <[email protected]> | 2015-11-25 16:19:06 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2015-12-01 14:48:55 -0800 |
commit | 48b4e88d3d2cfa2ccd912184cfdcbe559cd36ff0 (patch) | |
tree | b1163079735f6a56628592b5c2ff8100467c41ac | |
parent | 0e49151dcfe042d937e1ac3c6eab86bb0a68cf04 (diff) |
i965: Don't mark dead instructions' sources live.
Removes dead code from glsl-mat-from-int-ctor-03.shader_test.
Reported-by: Juan A. Suarez Romero <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
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 a50cf6f24f1..6b4b60224b7 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 @@ -109,6 +109,10 @@ fs_visitor::dead_code_eliminate() BITSET_CLEAR(flag_live, inst->flag_subreg); } + /* Don't mark dead instructions' sources as live */ + if (inst->opcode == BRW_OPCODE_NOP) + continue; + for (int i = 0; i < inst->sources; i++) { if (inst->src[i].file == VGRF) { int var = live_intervals->var_from_reg(inst->src[i]); diff --git a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp index 58aed810fcd..369941bb71e 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp @@ -150,6 +150,10 @@ vec4_visitor::dead_code_eliminate() BITSET_CLEAR(flag_live, c); } + /* Don't mark dead instructions' sources as live */ + if (inst->opcode == BRW_OPCODE_NOP) + continue; + for (int i = 0; i < 3; i++) { if (inst->src[i].file == VGRF) { for (unsigned j = 0; j < inst->regs_read(i); j++) { |