nir: Print selection control for nir_if.
authorGeorg Lehmann <dadschoorse@gmail.com>
Mon, 29 Aug 2022 15:18:56 +0000 (17:18 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 Aug 2022 23:16:51 +0000 (23:16 +0000)
It's useful to see this information now that aco is going to use it.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18297>

src/compiler/nir/nir_print.c

index edc83db..a3e1207 100644 (file)
@@ -1553,6 +1553,17 @@ print_if(nir_if *if_stmt, print_state *state, unsigned tabs)
    print_tabs(tabs, fp);
    fprintf(fp, "if ");
    print_src(&if_stmt->condition, state);
+   switch (if_stmt->control) {
+   case nir_selection_control_flatten:
+      fprintf(fp, " /* flatten */");
+      break;
+   case nir_selection_control_dont_flatten:
+      fprintf(fp, " /* don't flatten */");
+      break;
+   case nir_selection_control_none:
+   default:
+      break;
+   }
    fprintf(fp, " {\n");
    foreach_list_typed(nir_cf_node, node, node, &if_stmt->then_list) {
       print_cf_node(node, state, tabs + 1);