aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp12
1 files changed, 3 insertions, 9 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 4558bd42a24..5db31c3871d 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
@@ -53,17 +53,11 @@ fs_visitor::dead_code_eliminate()
foreach_inst_in_block_reverse_safe(fs_inst, inst, block) {
if (inst->dst.file == VGRF && !inst->has_side_effects()) {
+ const unsigned var = live_intervals->var_from_reg(inst->dst);
bool result_live = false;
- if (regs_written(inst) == 1) {
- int var = live_intervals->var_from_reg(inst->dst);
- result_live = BITSET_TEST(live, var);
- } else {
- int var = live_intervals->var_from_reg(inst->dst);
- for (unsigned i = 0; i < regs_written(inst); i++) {
- result_live = result_live || BITSET_TEST(live, var + i);
- }
- }
+ for (unsigned i = 0; i < regs_written(inst); i++)
+ result_live |= BITSET_TEST(live, var + i);
if (!result_live) {
progress = true;