Mesa (master): nir/spirv: remove unused fields from `vtn_builder`

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 8 18:50:36 UTC 2021


Module: Mesa
Branch: master
Commit: c6232afde0614005bd7338d998c79597de419ac3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6232afde0614005bd7338d998c79597de419ac3

Author: Andrii Simiklit <andrii.simiklit at globallogic.com>
Date:   Thu Apr  8 14:17:00 2021 +0300

nir/spirv: remove unused fields from `vtn_builder`

They were used for tracking whether SSA needed to be repaired,
but now the repair is done for all functions with structured control flow.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira at intel.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit at globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7755>

---

 src/compiler/spirv/vtn_cfg.c     |  5 -----
 src/compiler/spirv/vtn_private.h | 15 ---------------
 2 files changed, 20 deletions(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index dd91352bfbd..5a71fd98209 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -700,12 +700,10 @@ vtn_process_block(struct vtn_builder *b,
       return NULL;
 
    case SpvOpKill:
-      b->has_early_terminate = true;
       block->branch_type = vtn_branch_type_discard;
       return NULL;
 
    case SpvOpTerminateInvocation:
-      b->has_early_terminate = true;
       block->branch_type = vtn_branch_type_terminate_invocation;
       return NULL;
 
@@ -1170,8 +1168,6 @@ vtn_emit_cf_list_structured(struct vtn_builder *b, struct list_head *cf_list,
             nir_pop_if(&b->nb, cont_if);
 
             nir_store_var(&b->nb, do_cont, nir_imm_true(&b->nb), 1);
-
-            b->has_loop_continue = true;
          }
 
          nir_pop_loop(&b->nb, loop);
@@ -1377,7 +1373,6 @@ vtn_function_emit(struct vtn_builder *b, struct vtn_function *func,
    b->func = func;
    b->nb.cursor = nir_after_cf_list(&impl->body);
    b->nb.exact = b->exact;
-   b->has_loop_continue = false;
    b->phi_table = _mesa_pointer_hash_table_create(b);
 
    if (b->shader->info.stage == MESA_SHADER_KERNEL || force_unstructured) {
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index df16b8a335d..67c2d4420ae 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -717,21 +717,6 @@ struct vtn_builder {
    /* Current function parameter index */
    unsigned func_param_idx;
 
-   bool has_loop_continue;
-
-   /** True if this shader has any early termination instructions like OpKill
-    *
-    * In the SPIR-V, the following instructions are block terminators:
-    *
-    *  - OpKill
-    *  - OpTerminateInvocation
-    *
-    * However, in NIR, they're represented by regular intrinsics with no
-    * control-flow semantics.  This means that the SSA form from the SPIR-V
-    * may not 100% match NIR and we have to fix it up at the end.
-    */
-   bool has_early_terminate;
-
    /* false by default, set to true by the ContractionOff execution mode */
    bool exact;
 



More information about the mesa-commit mailing list