diff options
author | Francisco Jerez <[email protected]> | 2016-09-01 16:46:34 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2016-09-14 14:50:56 -0700 |
commit | 0bc46cc9619b8ae43e7a7c96bfe91f19371d301d (patch) | |
tree | 5a02fb8a9b48c015fd8ef75befafeea037b0f9a3 /src/mesa | |
parent | 62aaef6c83e4eb354bd7f15803db01e90d22fc34 (diff) |
i965/fs: Simplify result_live calculation in dead_code_eliminate().
No need to unroll the first iteration of the loop manually.
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp | 12 |
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; |