summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Perry <[email protected]>2020-01-31 16:47:10 +0000
committerMarge Bot <[email protected]>2020-03-23 15:55:12 +0000
commit46e94fd854e8f209ae662826e1794de4c5da2b80 (patch)
treed7b6a59f340040ddbbbcffe202360baff8baeeef /src
parent638cbc21a1c01c87f620edc820e913e48aba2287 (diff)
aco: skip NIR in unreachable merge blocks
NIR removes most of this but undef instructions for loop header phis can remain. These were harmless because ACO would DCE them itself. Signed-off-by: Rhys Perry <[email protected]> CC: <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3658>
Diffstat (limited to 'src')
-rw-r--r--src/amd/compiler/aco_instruction_selection.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 52db7f4a6b3..59668fb4bc1 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -8822,7 +8822,7 @@ static void end_divergent_if(isel_context *ctx, if_context *ic)
}
}
-static void visit_if(isel_context *ctx, nir_if *if_stmt)
+static bool visit_if(isel_context *ctx, nir_if *if_stmt)
{
Temp cond = get_ssa_temp(ctx, if_stmt->condition.ssa);
Builder bld(ctx->program, ctx->block);
@@ -8915,6 +8915,7 @@ static void visit_if(isel_context *ctx, nir_if *if_stmt)
ctx->block = ctx->program->insert_block(std::move(BB_endif));
append_logical_start(ctx->block);
}
+ return !ctx->cf_info.has_branch;
} else { /* non-uniform condition */
/**
* To maintain a logical and linear CFG without critical edges,
@@ -8950,6 +8951,8 @@ static void visit_if(isel_context *ctx, nir_if *if_stmt)
visit_cf_list(ctx, &if_stmt->else_list);
end_divergent_if(ctx, &ic);
+
+ return true;
}
}
@@ -8962,7 +8965,8 @@ static void visit_cf_list(isel_context *ctx,
visit_block(ctx, nir_cf_node_as_block(node));
break;
case nir_cf_node_if:
- visit_if(ctx, nir_cf_node_as_if(node));
+ if (!visit_if(ctx, nir_cf_node_as_if(node)))
+ return;
break;
case nir_cf_node_loop:
visit_loop(ctx, nir_cf_node_as_loop(node));