summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-08-08 23:29:56 -0700
committerKenneth Graunke <[email protected]>2013-08-19 11:29:24 -0700
commit597efd2b67d1afb8a95be38145c4f977ed36b672 (patch)
tree884455ef3e1c127876c1293aee9b58f9680e6780 /src/mesa
parent669d4d7f77648948800abce59bc99a29a338a3ad (diff)
i965/fs: Create the COPY() set for use in copy propagation dataflow.
This is the "COPY" set from Muchnick's textbook, which is necessary to do the dataflow algorithm correctly. v2: Simplify initialization based on Paul Berry's observation that out_acp contains exactly what needs to be in the COPY set. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index 634eb3d0a79..424d7b52dcc 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -61,6 +61,13 @@ struct block_data {
BITSET_WORD *liveout;
/**
+ * Which entries in the fs_copy_prop_dataflow acp table are generated by
+ * instructions in this block which reach the end of the block without
+ * being killed.
+ */
+ BITSET_WORD *copy;
+
+ /**
* Which entries in the fs_copy_prop_dataflow acp table are killed over the
* course of this block.
*/
@@ -110,6 +117,7 @@ fs_copy_prop_dataflow::fs_copy_prop_dataflow(void *mem_ctx, cfg_t *cfg,
for (int b = 0; b < cfg->num_blocks; b++) {
bd[b].livein = rzalloc_array(bd, BITSET_WORD, bitset_words);
bd[b].liveout = rzalloc_array(bd, BITSET_WORD, bitset_words);
+ bd[b].copy = rzalloc_array(bd, BITSET_WORD, bitset_words);
bd[b].kill = rzalloc_array(bd, BITSET_WORD, bitset_words);
for (int i = 0; i < ACP_HASH_SIZE; i++) {
@@ -117,6 +125,13 @@ fs_copy_prop_dataflow::fs_copy_prop_dataflow(void *mem_ctx, cfg_t *cfg,
acp_entry *entry = (acp_entry *)entry_node;
acp[next_acp] = entry;
+
+ /* opt_copy_propagate_local populates out_acp with copies created
+ * in a block which are still live at the end of the block. This
+ * is exactly what we want in the COPY set.
+ */
+ BITSET_SET(bd[b].copy, next_acp);
+
BITSET_SET(bd[b].liveout, next_acp);
next_acp++;
}