mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
pan/bi: Dead code eliminate per-channel
We already track the full liveness so this is a trivial optimization, with an especial win for shaders reading only a subset of components of gl_FragCoord. More importantly, it's required for proper scheduling (in soft mode) when vectors are used and some (but not all components) are promoted to temporary registers. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8354>
This commit is contained in:
parent
08d98290fe
commit
b8f042c9bb
1 changed files with 2 additions and 1 deletions
|
|
@ -46,8 +46,9 @@ bi_opt_dead_code_eliminate(bi_context *ctx, bi_block *block, bool soft)
|
|||
|
||||
bi_foreach_instr_in_block_safe_rev(block, ins) {
|
||||
unsigned index = bi_get_node(ins->dest[0]);
|
||||
bool index_live = (live[index] & bi_writemask(ins));
|
||||
|
||||
if (index < temp_count && !live[index]) {
|
||||
if (index < temp_count && !index_live) {
|
||||
if (soft || bi_side_effects(ins->op))
|
||||
ins->dest[0] = bi_null();
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue