mesa/src/compiler/nir/tests
Rhys Perry 65a54b4ec4 nir/lcssa: fix premature exit of loop after rematerializing derefs
If we have NIR such as:

32x4  %48 = @load_vulkan_descriptor (%47) (desc_type=SSBO)
32x4  %76 = deref_cast (tint_symbol_11 *)%48 (ssbo tint_symbol_11)  (ptr_stride=0, align_mul=4, align_offset=0)
32x4  %77 = deref_struct &%76->tint_symbol_10 (ssbo int)  // &((tint_symbol_11 *)%48)->tint_symbol_10

A single nir_rematerialize_deref_in_use_blocks() will rematerialize the
deref_struct and then it's deref_cast. However,
nir_foreach_instr_reverse_safe is not safe if the next iteration's
instruction is removed. This can result in the instruction loop exiting
and the load_vulkan_descriptor never having an LCSSA phi.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Fixes: 439e8c42cc ("nir/lcssa: Fix rematerializing derefs")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11770
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32225>
2024-11-19 18:59:05 +00:00
..
algebraic_parser_test.py
algebraic_tests.cpp nir: add mqsad_4x8, shfr and nir_opt_mqsad 2024-04-05 11:01:39 +00:00
builder_tests.cpp nir: Use glsl_type C helpers 2023-12-22 06:44:23 -08:00
comparison_pre_tests.cpp nir/comparison_pre_tests: update expectations 2024-01-17 16:01:12 +02:00
control_flow_tests.cpp nir/lcssa: fix premature exit of loop after rematerializing derefs 2024-11-19 18:59:05 +00:00
core_tests.cpp nir: nir_foreach_ssa_def() -> nir_foreach_def() 2023-08-13 17:12:52 +00:00
dce_tests.cpp nir: Take a nir_def * in nir_phi_instr_add_src() 2023-08-18 01:00:14 +00:00
format_convert_tests.cpp nir: Add a format unpack helper and tests 2024-06-19 01:56:22 +00:00
load_store_vectorizer_tests.cpp nir/opt_load_store_vectorize: allow a 4-byte hole between 2 loads 2024-10-15 05:50:24 +00:00
loop_analyze_tests.cpp nir/loop_analyze: Don't test non-positive iterations count 2023-12-19 12:53:52 +00:00
loop_unroll_tests.cpp nir/tests: Reenable tests that failed on big-endian 2024-01-10 21:47:30 +00:00
lower_alu_width_tests.cpp nir: Drop nir_dest 2023-08-14 21:22:53 +00:00
mod_analysis_tests.cpp nir s/nir_get_ssa_scalar/nir_get_scalar/ 2023-08-15 17:44:27 +00:00
negative_equal_tests.cpp nir: Drop "SSA" from NIR language 2023-08-12 16:44:41 -04:00
nir_opt_varyings_test.h nir/opt_varyings: don't generate IO with unsupported bit sizes 2024-03-31 03:02:51 +00:00
nir_test.h nir/algebraic: optimize vkd3d-proton's MSAD 2024-01-05 18:55:22 +00:00
opt_if_tests.cpp nir/tests: Add tests for opt_if_merge 2024-08-15 20:34:54 +00:00
opt_loop_tests.cpp nir/tests: test opt_loop_peel_initial_break with derefs in header block 2024-10-01 12:24:22 +00:00
opt_peephole_select.cpp nir/opt_peephole_select: handle speculative ubo loads 2024-01-03 20:02:25 +00:00
opt_shrink_vectors_tests.cpp nir/opt_shrink_vectors: shrink some intrinsics from start 2024-03-12 18:17:17 +00:00
opt_varyings_tests_bicm_binary_alu.cpp nir/opt_varyings: improve convergent input handling to fix data corruption 2024-07-23 16:13:16 +00:00
opt_varyings_tests_dead_input.cpp nir/tests: add tests for nir_opt_varyings 2024-03-15 19:55:46 +00:00
opt_varyings_tests_dead_output.cpp nir: validate src_type of store_output intrinsics, require bit_size >= 16 2024-05-01 19:41:35 +00:00
opt_varyings_tests_dedup.cpp nir/tests: add tests for nir_opt_varyings 2024-03-15 19:55:46 +00:00
opt_varyings_tests_prop_const.cpp nir/opt_varyings: Add workaround for RADV mesh shader multiview. 2024-04-14 19:51:12 +00:00
opt_varyings_tests_prop_ubo.cpp nir/opt_varyings: Add workaround for RADV mesh shader multiview. 2024-04-14 19:51:12 +00:00
opt_varyings_tests_prop_uniform.cpp nir/opt_varyings: Add workaround for RADV mesh shader multiview. 2024-04-14 19:51:12 +00:00
opt_varyings_tests_prop_uniform_expr.cpp nir/opt_varyings: Add workaround for RADV mesh shader multiview. 2024-04-14 19:51:12 +00:00
range_analysis_tests.cpp nir: Take a nir_def * in nir_phi_instr_add_src() 2023-08-18 01:00:14 +00:00
serialize_tests.cpp nir: Drop "SSA" from NIR language 2023-08-12 16:44:41 -04:00
vars_tests.cpp nir: Use glsl_type C helpers 2023-12-22 06:44:23 -08:00