ir3/ra: Fix tied destination handling with multiple destinations
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 2 Dec 2021 13:48:08 +0000 (14:48 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Mar 2022 17:15:29 +0000 (17:15 +0000)
commit077d07a983eceefca990ba78a0d8ed5c85b5c963
tree4f6fba6c61a78e1368ba7a654f4cb84008123113
parent9cc42242d5defc917fc0d4d1123db3a2c7cf7d96
ir3/ra: Fix tied destination handling with multiple destinations

Before, we were careful to

1. Get the source physreg.
2. Allocate the destination.
3. Insert a copy with the source being the physreg from step 1.

and this guaranteed that if the tied source were moved in step 2 we'd
still insert a copy from the correct place. However this won't work with
multiple destinations because an earlier destination could've already
moved the tied source around. Instead flip steps 2 and 3 (we'll insert
the copy before we allocate the interval, but that's ok) and run the
first two steps in a separate loop before any destinations are
allocated.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
src/freedreno/ir3/ir3_ra.c