diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2018-06-25 10:44:56 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2018-07-19 10:00:30 -0700 |
commit | e4f32dec23af18fa24fde56776150be713fc509e (patch) | |
tree | 6f8600930a68f6441d3cd0ddc6c11019daf822e0 /src/compiler/SConscript.spirv | |
parent | 7b0d39525005fbe48179328a3ed255a08c886519 (diff) |
glsl: change opt_copy_propagation_elements data structures
Instead of keeping multiple acp_entries in lists, have a single
acp_entry per variable. With this, the implementation of clone is more
convenient and now fully implemented. In the previous code, clone was
only partial.
Before this patch, each acp_entry struct represented a write to a
variable including LHS, RHS and a mask of what channels were written
to. There were two main hash tables, the first (lhs_ht) stored a list
of acp_entries per LHS variable, with the values available to copy for
that variable; the second (rhs_ht) was a "reverse index" for the first
hash table, so stored acp_entries per RHS variable.
After the patch, there's a single acp_entry struct per LHS variable,
it contains an array with references to the RHS variables per
channel. There now is a single hash table, from LHS variable to the
corresponding entry. The "reverse index" is stored in the ACP entry,
in the form of a set of variables that copy from the LHS. To make the
clone operation cheaper, the ACP entries are created on demand.
This should not change the result of copy propagation, a later patch
will take advantage of the clone operation.
v2: Add note clarifying how the hashtable is destroyed.
v3: (all from Eric Anholt)
Add remove_unused_var_from_dsts() function for reuse.
Remove from dsts as we go instead of clearing at the end.
Add clarifying comment to erase().
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/compiler/SConscript.spirv')
0 files changed, 0 insertions, 0 deletions