r300: fix variables detection for paired ALU and TEX instructions in different branches
authorPavel Ondračka <pavel.ondracka@gmail.com>
Wed, 10 Aug 2022 07:17:56 +0000 (09:17 +0200)
committerMarge Bot <emma+marge@anholt.net>
Sat, 13 Aug 2022 00:08:31 +0000 (00:08 +0000)
commit88fd397c741c0e1fe0d851fbc566925078df6013
tree9d26969eee14e68f3ba8e28f0b04c98a8813411d
parentb5df20568a6e60056211b634efa3bea4758f18e9
r300: fix variables detection for paired ALU and TEX instructions in different branches

TEX instrutions can't write xyz and w to separate registers so we
need to create variables from them first, otherwise we can create
two variables from ALU writing the same register xyz and w in other
branch (this usually works when TEX is not present as the xyz and
w can read/write from different registers).

This fixes regalloc because the variables are later used as a
graph nodes.

The variable order should not matter but it slightly does (leading
to approx 0.3% shader-db temps increase as compared to previous
state), so just sort the variables list afterwards to be as close
to the previous behavior as possible and prevent the regression.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6936
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17987>
src/gallium/drivers/r300/compiler/radeon_variable.c