brw/copy: Don't remove instructions w/ conditional modifier

Fixes: 9e750f00c3 ("intel/brw: Make opt_copy_propagation_defs clean up its own trash")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31834>
This commit is contained in:
Ian Romanick 2024-10-01 09:42:00 -07:00 committed by Marge Bot
parent d949d47f09
commit 8329c04521

View file

@ -1849,8 +1849,17 @@ brw_fs_opt_copy_propagation_defs(fs_visitor &s)
if (source_progress) {
instruction_progress = true;
++uses_deleted[def->dst.nr];
if (defs.get_use_count(def->dst) == uses_deleted[def->dst.nr])
/* We can copy propagate through an instruction like
*
* mov.nz.f0.0(8) %2:D, -%78:D
*
* but deleting the instruction may alter the program.
*/
if (def->conditional_mod == BRW_CONDITIONAL_NONE &&
defs.get_use_count(def->dst) == uses_deleted[def->dst.nr]) {
def->remove(defs.get_block(def->dst), true);
}
}
}