Commit f9d54dc3 authored by Eric Anholt's avatar Eric Anholt

v3d: Add some debug code for forcing register spilling.

This is useful for periodically testing out register spilling to see how
it goes on simple shaders, rather than only failing on insanely
complicated ones.
parent aaa41cd2
......@@ -520,6 +520,20 @@ v3d_register_allocate(struct v3d_compile *c, bool *spilled)
/* Debug code to force a bit of register spilling, for running across
* conformance tests to make sure that spilling works.
int force_register_spills = 0;
if (c->spill_size < 16 * sizeof(uint32_t) * force_register_spills) {
int node = v3d_choose_spill_node(c, g, temp_to_node);
if (node != -1) {
v3d_spill_reg(c, map[node].temp);
*spilled = true;
return NULL;
bool ok = ra_allocate(g);
if (!ok) {
/* Try to spill, if we can't reduce threading first. */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment