mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
aco: save/reset/combine has_divergent_continue in uniform branches
For
if (uniform) {
if (divergent)
continue
} else {
break
}
we don't need to consider the continue to be divergent.
No fossil-db changes.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28301>
This commit is contained in:
parent
46c734ff02
commit
0a25af1d4e
1 changed files with 7 additions and 0 deletions
|
|
@ -56,6 +56,8 @@ struct if_context {
|
|||
bool exec_potentially_empty_break_old;
|
||||
bool had_divergent_discard_old;
|
||||
bool had_divergent_discard_then;
|
||||
bool has_divergent_continue_old;
|
||||
bool has_divergent_continue_then;
|
||||
uint16_t exec_potentially_empty_break_depth_old;
|
||||
|
||||
unsigned BB_if_idx;
|
||||
|
|
@ -10650,6 +10652,7 @@ begin_uniform_if_then(isel_context* ctx, if_context* ic, Temp cond)
|
|||
ctx->cf_info.parent_loop.has_divergent_branch = false;
|
||||
|
||||
ic->had_divergent_discard_old = ctx->cf_info.had_divergent_discard;
|
||||
ic->has_divergent_continue_old = ctx->cf_info.parent_loop.has_divergent_continue;
|
||||
|
||||
/** emit then block */
|
||||
ctx->program->next_uniform_if_depth++;
|
||||
|
|
@ -10686,6 +10689,9 @@ begin_uniform_if_else(isel_context* ctx, if_context* ic)
|
|||
ic->had_divergent_discard_then = ctx->cf_info.had_divergent_discard;
|
||||
ctx->cf_info.had_divergent_discard = ic->had_divergent_discard_old;
|
||||
|
||||
ic->has_divergent_continue_then = ctx->cf_info.parent_loop.has_divergent_continue;
|
||||
ctx->cf_info.parent_loop.has_divergent_continue = ic->has_divergent_continue_old;
|
||||
|
||||
/** emit else block */
|
||||
Block* BB_else = ctx->program->create_and_insert_block();
|
||||
add_edge(ic->BB_if_idx, BB_else);
|
||||
|
|
@ -10714,6 +10720,7 @@ end_uniform_if(isel_context* ctx, if_context* ic)
|
|||
ctx->cf_info.has_branch &= ic->uniform_has_then_branch;
|
||||
ctx->cf_info.parent_loop.has_divergent_branch &= ic->then_branch_divergent;
|
||||
ctx->cf_info.had_divergent_discard |= ic->had_divergent_discard_then;
|
||||
ctx->cf_info.parent_loop.has_divergent_continue |= ic->has_divergent_continue_then;
|
||||
|
||||
/** emit endif merge block */
|
||||
ctx->program->next_uniform_if_depth--;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue