diff --git a/.pick_status.json b/.pick_status.json index 0e151cc87e8..2dd59390161 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -10054,7 +10054,7 @@ "description": "aco/spill: skip p_branch in process_block", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index 93b7c975252..38e25dba3df 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -1186,6 +1186,15 @@ process_block(spill_ctx& ctx, unsigned block_idx, Block* block, RegisterDemand s while (idx < block->instructions.size()) { aco_ptr& instr = block->instructions[idx]; + /* Spilling is handled as part of phis (they should always have the same or higher register + * demand). If we try to spill here, we might not be able to reduce the register demand enough + * because there is no path to spill constant/undef phi operands. */ + if (instr->opcode == aco_opcode::p_branch) { + instructions.emplace_back(std::move(instr)); + idx++; + continue; + } + std::map> reloads; /* rename and reload operands */