pan/bi: Implement spilling

Now that all the helpers are in place, we can wire it up.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7206>
This commit is contained in:
Alyssa Rosenzweig
2020-10-14 20:45:19 -04:00
committed by Marge Bot
parent e33b2976f3
commit b43b1535e2

View File

@@ -349,6 +349,9 @@ bi_register_allocate(bi_context *ctx)
unsigned iter_count = 100; /* max iterations */
/* Number of bytes of memory we've spilled into */
unsigned spill_count = 0;
/* For instructions that both read and write from a data register, it's
* the *same* data register. We enforce that constraint by just doing a
* quick rewrite. TODO: are there cases where this causes RA to have no
@@ -372,13 +375,15 @@ bi_register_allocate(bi_context *ctx)
if (spill_node == -1)
unreachable("Failed to choose spill node\n");
unreachable("Spilling not implemented");
spill_count += bi_spill_register(ctx, spill_node, spill_count);
}
bi_invalidate_liveness(ctx);
l = bi_allocate_registers(ctx, &success);
} while(!success && ((iter_count--) > 0));
assert(success);
bi_install_registers(ctx, l);
lcra_free(l);