nir/opt_if: Don't split ALU for single block infinite loops
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Fri, 18 Jun 2021 19:24:11 +0000 (12:24 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 25 Jun 2021 22:41:32 +0000 (22:41 +0000)
commitb9519297955c3a75095f986b0e29afaf3a8c923a
tree888174130cf4e2db8ba3fbf718dac5da1e0faccc
parent7b89e4d1048d6104f07930d3717ee543253dad50
nir/opt_if: Don't split ALU for single block infinite loops

Some infinite loop cases were already covered by other
restrictions (e.g. if the loop had a body), but the case with a single
block in the loop body wasn't yet.

This prevents an infinite loop when optimizing the shader in
dEQP-VK.reconvergence.subgroup_uniform_control_flow_ballot.compute.nesting2.3.2
and various others reconvergence tests.

Fixes: 0881e90c099 ("nir: Split ALU instructions in loops that read phis")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11476>
src/compiler/nir/nir_opt_if.c