aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_cfg.h
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2015-11-30 09:25:19 -0800
committerMatt Turner <[email protected]>2015-12-01 14:48:55 -0800
commit7e6a6f3e619e7dfed244043a95082f2168a5c953 (patch)
tree3bbfbb81435b2680d9f567c89b91bb7fb2aa4914 /src/mesa/drivers/dri/i965/brw_cfg.h
parent5a6f0bf5b810c82b2ddc6c2a9c7cb392d7421eed (diff)
i965: Do dead-code elimination in a single pass.
The first pass marked dead instructions as opcode = NOP, and a second pass deleted those instructions so that the live ranges used in the first pass wouldn't change. But since we're walking the instructions in reverse order, we can just do everything in one pass. The only thing we have to do is walk the blocks in reverse as well. Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_cfg.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_cfg.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cfg.h b/src/mesa/drivers/dri/i965/brw_cfg.h
index 69e39e8964d..405020b77e5 100644
--- a/src/mesa/drivers/dri/i965/brw_cfg.h
+++ b/src/mesa/drivers/dri/i965/brw_cfg.h
@@ -314,6 +314,9 @@ struct cfg_t {
#define foreach_block_safe(__block, __cfg) \
foreach_list_typed_safe (bblock_t, __block, link, &(__cfg)->block_list)
+#define foreach_block_reverse_safe(__block, __cfg) \
+ foreach_list_typed_reverse_safe (bblock_t, __block, link, &(__cfg)->block_list)
+
#define foreach_inst_in_block(__type, __inst, __block) \
foreach_in_list(__type, __inst, &(__block)->instructions)