nir: Print divergence status of SSA values if analysis was ever run.
After running divergence analysis, we include "div" or "con" for each SSA def's divergence/convergence status: vec1 32 div ssa_35 = fddy ssa_34 vec1 32 con ssa_36 = fddy ssa_6.x We omit this before the first time divergence analysis has been run. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15445>
This commit is contained in:
@@ -993,6 +993,8 @@ visit_cf_list(struct exec_list *list, struct divergence_state *state)
|
||||
void
|
||||
nir_divergence_analysis(nir_shader *shader)
|
||||
{
|
||||
shader->info.divergence_analysis_run = true;
|
||||
|
||||
struct divergence_state state = {
|
||||
.stage = shader->info.stage,
|
||||
.shader = shader,
|
||||
|
@@ -106,8 +106,13 @@ static void
|
||||
print_ssa_def(nir_ssa_def *def, print_state *state)
|
||||
{
|
||||
FILE *fp = state->fp;
|
||||
fprintf(fp, "%s %u ssa_%u", sizes[def->num_components], def->bit_size,
|
||||
def->index);
|
||||
|
||||
const char *divergence = "";
|
||||
if (state->shader->info.divergence_analysis_run)
|
||||
divergence = def->divergent ? "div " : "con ";
|
||||
|
||||
fprintf(fp, "%s %2u %sssa_%u", sizes[def->num_components], def->bit_size,
|
||||
divergence, def->index);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -254,6 +254,9 @@ typedef struct shader_info {
|
||||
*/
|
||||
bool uses_fddx_fddy:1;
|
||||
|
||||
/** Has divergence analysis ever been run? */
|
||||
bool divergence_analysis_run:1;
|
||||
|
||||
/* Bitmask of bit-sizes used with ALU instructions. */
|
||||
uint8_t bit_sizes_float;
|
||||
uint8_t bit_sizes_int;
|
||||
|
Reference in New Issue
Block a user