mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 11:00:11 +01:00
ir3: run opt_if after opt_vectorize
nir_opt_vectorize could replace swizzled movs with vectorized movs in a different block. If this happens with swizzled movs in a then block, it could leave this block empty. ir3 assumes only the else block can be empty (e.g., when lowering predicates) so make sure ifs are in that canonical form again. This fixes empty predication blocks in some shaders, for example: predt predf ... prede Signed-off-by: Job Noorman <jnoorman@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34272>
This commit is contained in:
parent
ee0ee2a317
commit
02ff26be38
1 changed files with 8 additions and 0 deletions
|
|
@ -120,6 +120,14 @@ ir3_context_init(struct ir3_compiler *compiler, struct ir3_shader *shader,
|
|||
NIR_PASS(_, ctx->s, nir_opt_undef);
|
||||
NIR_PASS(_, ctx->s, nir_copy_prop);
|
||||
NIR_PASS(_, ctx->s, nir_opt_dce);
|
||||
|
||||
/* nir_opt_vectorize could replace swizzled movs with vectorized movs in a
|
||||
* different block. If this happens with swizzled movs in a then block, it
|
||||
* could leave this block empty. ir3 assumes only the else block can be
|
||||
* empty (e.g., when lowering predicates) so make sure ifs are in that
|
||||
* canonical form again.
|
||||
*/
|
||||
NIR_PASS(_, ctx->s, nir_opt_if, 0);
|
||||
}
|
||||
|
||||
NIR_PASS(progress, ctx->s, nir_convert_to_lcssa, true, true);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue