OSDN Git Service

nv50/ir: make edge splitting fix up phi node sources
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 10 Sep 2015 05:54:30 +0000 (01:54 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 11 Sep 2015 18:19:31 +0000 (19:19 +0100)
commit78612aba51f0b7bb07419ed4b54c2d878b5e7b65
tree765a6e5fb44a0dc1d81cb2deccb85f3de33773c1
parent0878187488008facccbdae1b0e5258234a2b9dd4
nv50/ir: make edge splitting fix up phi node sources

Unfortunately nv50_ir phi nodes aren't directly connected to the CFG, so
the mapping between source and the actual BB is by inbound edge order.
So when manipulating edges one has to be extremely careful. We were
insufficiently careful when splitting critical edges which resulted in
the phi nodes being confused as to where their sources were coming from.

This primarily manifests itself with the TXL-lowering logic on nv50,
when it is inside of a conditional. I've been unable to trigger the
issue anywhere else so far. This resolves rendering failures
in a number of games like Two Worlds 2, Trine: Enchanted Edition, Trine 2,
XCOM:Enemy Unknown, Stacking. It also improves the situation in
Hearthstone, Sonic Generations, and The Raven: Legacy of a Master Thief.
However more work needs to be done there (splitting a lot more edges
solves it, so it's some other sort of RA-related issue).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90887
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a072ef8748a65d286e9b542bb9ea6e020fdcc7f8)
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp