ir3/postsched: Make sure to schedule inputs before kill
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 25 Feb 2021 10:14:53 +0000 (11:14 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 9 Apr 2021 16:31:29 +0000 (16:31 +0000)
commitba796d511501a6cea601ff51b8b6dbb09ea514f4
tree4c42ceec44d4bc2c30aaa011927fd959cc70ab78
parente11df07e5413a7df40ec7427a20212e53f41cf63
ir3/postsched: Make sure to schedule inputs before kill

Before, we would prefer to schedule inputs before kills, which works
assuming that the live range of the bary_ij system value don't get
split and therefore all bary.f are ready at the start of the block.
However live range splitting can mess up that assumption and cause a
kill to get scheduled before a move that leads to a bary.f.

This fixes even e.g. dEQP-GLES2.functional.shaders.discard.basic_always
on a3xx before introducing CSE of collect instructions, but even after
that it could be a problem theoretically as the register allocator
doesn't guarantee that any live ranges aren't split.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10143>
src/freedreno/ir3/ir3_postsched.c