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>
}
}
+ 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;
}
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;