ir3: fix reconvergence of blocks with multiple divergent predecessors

When calling ir3_calc_reconvergence after opt_jump, it may happen that
there are multiple divergent branches to the same block. This was
handled incorrectly since first_divergent_pred was unconditionally
overwritten for successors of divergent branches. This patch fixes this
by only making sure only the earliest divergent predecessor is used.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29409>
This commit is contained in:
Job Noorman
2024-08-16 15:54:24 +02:00
committed by Marge Bot
parent d9977a6176
commit c67381538d
+6 -1
View File
@@ -222,7 +222,12 @@ ir3_calc_reconvergence(struct ir3_shader_variant *so)
for (unsigned i = 0; i < num_reconv_points; i++) {
struct ir3_block *reconv_point = reconv_points[i];
reconv_point->reconvergence_point = true;
blocks[reconv_point->index].first_divergent_pred = block->index;
struct block_data *reconv_point_data = &blocks[reconv_point->index];
if (reconv_point_data->first_divergent_pred > block->index) {
reconv_point_data->first_divergent_pred = block->index;
}
u_worklist_push_tail(&worklist, reconv_point, index);
}
}