aco/spill: Fix spilling of Phi operands

By adding the renamed variable, phi operands got spilled twice at the precessors.

Fixes: dEQP-VK.ray_query.misc.dynamic_indexing
Closes: #7493
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19109>
(cherry picked from commit ebf7f7a182)
This commit is contained in:
Daniel Schürmann
2022-10-17 11:40:40 +02:00
committed by Dylan Baker
parent 86f250ac27
commit f9dc71cebe
2 changed files with 4 additions and 2 deletions

View File

@@ -13,7 +13,7 @@
"description": "aco/spill: Fix spilling of Phi operands",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -920,8 +920,10 @@ add_coupling_code(spill_ctx& ctx, Block* block, unsigned block_idx)
pred.instructions[idx]->opcode != aco_opcode::p_logical_end);
std::vector<aco_ptr<Instruction>>::iterator it = std::next(pred.instructions.begin(), idx);
pred.instructions.insert(it, std::move(spill));
/* Add the original name to predecessor's spilled variables */
if (spill_op.isTemp())
ctx.spills_exit[pred_idx][spill_op.getTemp()] = spill_id;
ctx.spills_exit[pred_idx][phi->operands[i].getTemp()] = spill_id;
}
/* remove phi from instructions */