aco: split self-intersecting copies instead of swapping
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 27 Apr 2020 19:13:53 +0000 (20:13 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 23:16:55 +0000 (23:16 +0000)
commit09c584caeb2a1e7446ac2016ce7a7d8f0586774b
tree733e7414bf600a78ed1d07f700765d25561da042
parentbe4a34966ceefbaf70cecb56a8300a31c5b0ca46
aco: split self-intersecting copies instead of swapping

Example situation:
v1 = {v0.hi, v1.lo}
v0.hi = v1.hi

The 4-byte copy's definition is completely used, but swapping it makes no
sense. We have to split it to generate correct code:
swap(v0.hi, v1.lo)
swap(v0.hi, v1.hi)

Found in dEQP-VK.spirv_assembly.type.vec3.i16.constant_composite_vert

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4772>
src/amd/compiler/aco_lower_to_hw_instr.cpp