aco: handle loop exit and IF merge phis with break/discard
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 18 Nov 2019 17:26:38 +0000 (17:26 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 2 Dec 2019 16:56:19 +0000 (16:56 +0000)
commit0e8da9f60718520d1c3abd335a047282bb760b78
tree382105e6021ad6d25c5071deefd0da0ab470e496
parent06fc83989c04368f14e004ba5543c6b5daa6c098
aco: handle loop exit and IF merge phis with break/discard

ACO considers discards jumps and creates edges in the CFG for them but NIR
does neither of these.

This can be fixed instead by keeping track of whether a side of an IF had
a break/discard, but this doesn't solve the issue with discards affecting
loop exit phis. So this reworks phi handling a bit.

Fixes these tests:
dEQP-VK.graphicsfuzz.disc-and-add-in-func-in-loop
dEQP-VK.graphicsfuzz.loop-call-discard
dEQP-VK.graphicsfuzz.complex-nested-loops-and-call

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/amd/compiler/aco_instruction_selection.cpp
src/amd/compiler/aco_instruction_selection_setup.cpp