mesa/src/compiler
Danylo Piliaiev 96cde77846 nir/opt_if: Fix opt_if_simplification when else branch has jump
Consider the following case:

 if ssa_1 {
    block block_2:
    /* succs: block_4 */
 } else {
    block block_3:
    ...
    break
    /* succs: block_5 */
 }

 block block_4:
 vec1 32 ssa_100 = phi block_2: ssa_2

After block_3 extraction and reinsertion, phi->pred becomes invalid
and isn't updated by reinsertion since it is unreachable from block_3.

Call nir_opt_remove_phis_block before moving block to eliminate single
source phis after the if.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3282
Fixes: e3e929f8c3
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5945>
(cherry picked from commit 6f94b3da11)
2020-07-22 22:30:05 +02:00
..
glsl glsl: only allow 32 bits atomic operations on images 2020-07-22 22:30:03 +02:00
nir nir/opt_if: Fix opt_if_simplification when else branch has jump 2020-07-22 22:30:05 +02:00
spirv spirv: Allow block-decorated struct types for constants 2020-07-22 22:30:04 +02:00
Android.glsl.gen.mk mesa: android: Remove unnecessary dependency tracking rules 2019-05-06 11:29:25 +00:00
Android.glsl.mk
Android.mk
Android.nir.gen.mk nir: Add missing dependency in Android.nir.gen.mk 2019-08-19 09:53:18 +03:00
Android.nir.mk android: fix libmesa_nir build 2017-07-21 08:47:56 +03:00
builtin_type_macros.h glsl_types: vec8/vec16 support 2018-03-25 10:42:54 -04:00
glsl_types.cpp glsl: fix race in instance getters 2020-03-30 20:17:43 +00:00
glsl_types.h glsl: Add type queries for fp16+float and fp16+float+double 2020-03-09 16:31:08 +00:00
Makefile.sources nir: Move nir_lower_mediump_outputs from ir3 2020-04-27 16:32:24 +00:00
meson.build meson: inline inc_common 2020-03-28 21:36:54 +01:00
nir_types.cpp nir/lower_amul: fix slot calculation 2020-04-06 18:00:17 +00:00
nir_types.h nir/lower_amul: fix slot calculation 2020-04-06 18:00:17 +00:00
SConscript spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
SConscript.glsl Move compiler.h and imports.h/c from src/mesa/main into src/util 2020-03-27 21:00:09 +00:00
SConscript.nir nir: mako all the intrinsics 2018-03-27 08:36:37 -04:00
SConscript.spirv spirv: Fix building with SCons 2018-03-30 14:33:03 -06:00
shader_enums.c compiler: add VARYING_SLOT_VIEWPORT_MASK 2020-04-15 20:12:00 -04:00
shader_enums.h compiler: add VARYING_SLOT_VIEWPORT_MASK 2020-04-15 20:12:00 -04:00
shader_info.h glsl: add NV_viewport_array2 support 2020-04-15 20:12:00 -04:00