Mesa (staging/20.0): aco: consider blocks unreachable if they are in the logical cfg

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 7 02:29:41 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 58653838f55031176796cb5843cc2a1f91a8f464
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=58653838f55031176796cb5843cc2a1f91a8f464

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Mon Apr 27 13:53:59 2020 +0100

aco: consider blocks unreachable if they are in the logical cfg

backport of 9392ddab4399d796fdf37602f586965ec17f2b2a

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4888>

---

 src/amd/compiler/aco_instruction_selection.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 0b69eb51c89..7f0b9148daa 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -8276,7 +8276,6 @@ static bool 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,
@@ -8312,9 +8311,9 @@ static bool visit_if(isel_context *ctx, nir_if *if_stmt)
       visit_cf_list(ctx, &if_stmt->else_list);
 
       end_divergent_if(ctx, &ic);
-
-      return true;
    }
+
+   return !ctx->cf_info.has_branch && !ctx->block->logical_preds.empty();
 }
 
 static bool visit_cf_list(isel_context *ctx,



More information about the mesa-commit mailing list