nir: fix opt_if_loop_last_continue()
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 13 Dec 2018 23:23:27 +0000 (10:23 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 14 Dec 2018 06:21:35 +0000 (17:21 +1100)
commita2ec78883f402ccfb60bce3c35ec819061e6338f
treed1ec9bd7920914151c66a1df402f26b69c5def97
parent0ac5acaeaaa651d850d77ebab094fa851a7ee06d
nir: fix opt_if_loop_last_continue()

The pass did not correctly handle loops ending in:

if ssa_7 {
block block_8:
/* preds: block_7 */
continue
/* succs: block_1 */
} else {
block block_9:
/* preds: block_7 */
break
/* succs: block_11 */
}

The break will get eliminated by another opt but if this pass gets
called first (as it does on RADV) we ended up inserting
instructions after the break.

Fixes: 5921a19d4b0c ("nir: add if opt opt_if_loop_last_continue()")
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/compiler/nir/nir_opt_if.c