r600/sb: Don't create three source ops with all kcache values

There is a good chance that the created instruction can't be
scheduled, so avoid this case.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16499>
This commit is contained in:
Gert Wollny 2022-05-10 20:04:09 +02:00 committed by Marge Bot
parent d9048e31a0
commit d8e6abf542
2 changed files with 8 additions and 1 deletions

View File

@ -174,10 +174,11 @@ void gvn::process_alu_src_constants(node &n, value* &v) {
}
}
unsigned kcache_count = 0;
for (vvec::iterator I = n.src.begin(), E = n.src.end(); I != E; ++I) {
value *c = (*I);
if (c->is_kcache() && !kc.try_reserve(c->select)) {
if (c->is_kcache() && (!kc.try_reserve(c->select) || ++kcache_count == 2)) {
process_src(v, false);
return;
}

View File

@ -268,6 +268,12 @@ void peephole::optimize_CNDcc_op(alu_node* a) {
if (d->bc.src[nds].abs)
return;
// Don't create an instruction that uses three kcache values
// chances are high that it can't be scheduled
if (d->src[0]->is_kcache() && a->src[1]->is_kcache() &&
a->src[2]->is_kcache())
return;
// TODO we can handle some cases for uint comparison
if (dcmp_type == AF_UINT_CMP)
return;