r600/sfn: Don't copy propagate indirect loads to more than one dest

Propagating the indirect load to more instructions would result
in more address load instructions. This would (a) remove the advantage
of eliminating one move, and (b) introduce more latency, because between
address load and use two cycles must pass.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
This commit is contained in:
Gert Wollny
2023-02-10 15:57:13 +01:00
committed by Marge Bot
parent d1f419b365
commit b406cfd922
@@ -360,6 +360,16 @@ CopyPropFwdVisitor::visit(AluInstr *instr)
auto src = instr->psrc(0);
auto dest = instr->dest();
/* Don't propagate an indirect load to more than one
* instruction, because we may have to split the address loads
* creating more instructions */
if (dest->uses().size() > 1) {
auto [addr, is_for_dest, index] = instr->indirect_addr();
if (addr && !is_for_dest)
return;
}
auto ii = dest->uses().begin();
auto ie = dest->uses().end();