aco: don't consider loop header blocks branch blocks in add_coupling_code
[mesa.git] / src / amd / compiler / aco_spill.cpp
index e0c3ea955cd4312538d5ae95643b3ffec6932d8e..576b8e02aea60d96a1a17988102b16bf3fd9b3c3 100644 (file)
@@ -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;