mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-05 08:00:30 +01:00
nv50/ir: fix false global CSE on instructions with multiple defs
If an instruction has multiple defs, we have to do a lot more checks to
make sure that we can move it forward. Among other things, various code
likes to do
a, b = tex()
if () c = a
else c = b
which means that a single phi node will have results pointing at the
same instruction. We obviously can't propagate the tex in this case, but
properly accounting for this situation is tricky. Just don't try for
instructions with multiple defs.
This fixes about 20 shaders in shader-db, including the dolphin efb2ram
shader.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
This commit is contained in:
parent
3ca2001b53
commit
3ca941d60e
1 changed files with 2 additions and 0 deletions
|
|
@ -3075,6 +3075,8 @@ GlobalCSE::visit(BasicBlock *bb)
|
|||
ik = phi->getSrc(0)->getInsn();
|
||||
if (!ik)
|
||||
continue; // probably a function input
|
||||
if (ik->defCount(0xff) > 1)
|
||||
continue; // too painful to check if we can really push this forward
|
||||
for (s = 1; phi->srcExists(s); ++s) {
|
||||
if (phi->getSrc(s)->refCount() > 1)
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue