Mesa (master): aco: don't consider loop header blocks branch blocks in add_coupling_code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 29 18:23:33 UTC 2020


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Jan  2 14:54:31 2020 +0000

aco: don't consider loop header blocks branch blocks in add_coupling_code

Loops without continues create header blocks with only 1 predecessor.

CC: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3257>

---

 src/amd/compiler/aco_spill.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp
index e0c3ea955cd..576b8e02aea 100644
--- a/src/amd/compiler/aco_spill.cpp
+++ b/src/amd/compiler/aco_spill.cpp
@@ -665,7 +665,7 @@ void add_coupling_code(spill_ctx& ctx, Block* block, unsigned block_idx)
 
    std::vector<aco_ptr<Instruction>> instructions;
    /* branch block: TODO take other branch into consideration */
-   if (block->linear_preds.size() == 1 && !(block->kind & block_kind_loop_exit)) {
+   if (block->linear_preds.size() == 1 && !(block->kind & (block_kind_loop_exit | block_kind_loop_header))) {
       assert(ctx.processed[block->linear_preds[0]]);
       assert(ctx.register_demand[block_idx].size() == block->instructions.size());
       std::vector<RegisterDemand> reg_demand;



More information about the mesa-commit mailing list