mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
aco: Don't remove exec writes that also write other registers.
Don't eliminate an instruction that writes registers other than exec and scc.
It is possible that this is eg. an s_and_saveexec and the saved value is
used by a later branch.
Fixes: bc13049747
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21493>
This commit is contained in:
parent
54da863956
commit
0211e66f65
1 changed files with 9 additions and 1 deletions
|
|
@ -596,7 +596,15 @@ eliminate_useless_exec_writes_in_block(ssa_elimination_ctx& ctx, Block& block)
|
|||
|
||||
/* See if we found an unused exec write. */
|
||||
if (writes_exec && !exec_write_used) {
|
||||
instr.reset();
|
||||
/* Don't eliminate an instruction that writes registers other than exec and scc.
|
||||
* It is possible that this is eg. an s_and_saveexec and the saved value is
|
||||
* used by a later branch.
|
||||
*/
|
||||
bool writes_other = std::any_of(instr->definitions.begin(), instr->definitions.end(),
|
||||
[](const Definition& def) -> bool
|
||||
{ return def.physReg() != exec && def.physReg() != scc; });
|
||||
if (!writes_other)
|
||||
instr.reset();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue