From fdf8ad0256da38991e391bb08c8d0b5b351f86ec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 30 Oct 2019 12:04:22 +0100 Subject: [PATCH] aco: consider loop_exit blocks like merge blocks, even if they have only one predecessor Reviewed-by: Rhys Perry --- src/amd/compiler/aco_spill.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index 1668360eac0..4c7a45ad6df 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -467,7 +467,7 @@ RegisterDemand init_live_in_vars(spill_ctx& ctx, Block* block, unsigned block_id } /* branch block */ - if (block->linear_preds.size() == 1) { + if (block->linear_preds.size() == 1 && !(block->kind & block_kind_loop_exit)) { /* keep variables spilled if they are alive and not used in the current block */ unsigned pred_idx = block->linear_preds[0]; for (std::pair pair : ctx.spills_exit[pred_idx]) { @@ -654,7 +654,7 @@ void add_coupling_code(spill_ctx& ctx, Block* block, unsigned block_idx) std::vector> instructions; /* branch block: TODO take other branch into consideration */ - if (block->linear_preds.size() == 1) { + if (block->linear_preds.size() == 1 && !(block->kind & block_kind_loop_exit)) { assert(ctx.processed[block->linear_preds[0]]); if (block->logical_preds.size() == 1) { -- 2.30.2