diff options
author | Kenneth Graunke <[email protected]> | 2013-08-09 18:34:11 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-08-19 11:29:24 -0700 |
commit | 1d40c784f22dcbe814e7915d1fae45774a264526 (patch) | |
tree | f8e9cb189a68181705db28f7f76b0462bd54bf48 /src/mesa | |
parent | f06826cece7ad6348c93760e473e5a35ad872431 (diff) |
i965/fs: Properly initialize the livein/liveout sets.
Previously, livein was initialized to 0 for all blocks. According to
the textbook, it should be the universal set (~0) for all blocks except
the one representing the start of the program (which should be 0).
liveout also needs to be initialized to COPY for the initial block.
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.cpp | 21 |
1 files changed, 21 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 9ffb64deb85..81e3693286a 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp @@ -151,6 +151,7 @@ fs_copy_prop_dataflow::fs_copy_prop_dataflow(void *mem_ctx, cfg_t *cfg, void fs_copy_prop_dataflow::setup_initial_values() { + /* Initialize the COPY and KILL sets. */ for (int b = 0; b < cfg->num_blocks; b++) { bblock_t *block = cfg->blocks[b]; @@ -169,6 +170,26 @@ fs_copy_prop_dataflow::setup_initial_values() } } } + + /* Populate the initial values for the livein and liveout sets. For the + * block at the start of the program, livein = 0 and liveout = copy. + * For the others, set liveout to 0 (the empty set) and livein to ~0 + * (the universal set). + */ + for (int b = 0; b < cfg->num_blocks; b++) { + bblock_t *block = cfg->blocks[b]; + if (block->parents.is_empty()) { + for (int i = 0; i < bitset_words; i++) { + bd[b].livein[i] = 0u; + bd[b].liveout[i] = bd[b].copy[i]; + } + } else { + for (int i = 0; i < bitset_words; i++) { + bd[b].liveout[i] = 0u; + bd[b].livein[i] = ~0u; + } + } + } } /** |