mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
aco/spill: Fix assertion for nested loops
Fixes: 898fd9227a ('aco/spill: keep loop variables spilled during nested loops')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27799>
This commit is contained in:
parent
c38a2ab993
commit
66616f0862
1 changed files with 5 additions and 3 deletions
|
|
@ -535,9 +535,11 @@ init_live_in_vars(spill_ctx& ctx, Block* block, unsigned block_idx)
|
|||
if (!ctx.loop.empty()) {
|
||||
/* If this is a nested loop, keep variables from the outer loop spilled. */
|
||||
for (auto spilled : ctx.loop.back().spills) {
|
||||
assert(next_use_distances.count(spilled.first));
|
||||
|
||||
if (ctx.spills_entry[block_idx].insert(spilled).second) {
|
||||
/* If the inner loop comes after the last continue statement of the outer loop,
|
||||
* the loop-carried variables might not be live-in for the inner loop.
|
||||
*/
|
||||
if (next_use_distances.count(spilled.first) &&
|
||||
ctx.spills_entry[block_idx].insert(spilled).second) {
|
||||
spilled_registers += spilled.first;
|
||||
loop_demand -= spilled.first;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue