diff --git a/docs/envvars.rst b/docs/envvars.rst index d48f3ece59a..b2351f23b19 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -2214,6 +2214,12 @@ PowerVR driver environment variables ``global_shmem`` Force spill shared memory to global memory. + ``ra_force_spill`` + Force spilling of temps during register allocation. + + ``ra_skip_opt`` + Skip attempting to allocate temps with the optimal amount during RA. + .. envvar:: PCO_SKIP_PASSES A comma-separated list of passes to skip. diff --git a/src/imagination/pco/pco_debug.c b/src/imagination/pco/pco_debug.c index 0b55629fc2b..b8b5390d057 100644 --- a/src/imagination/pco/pco_debug.c +++ b/src/imagination/pco/pco_debug.c @@ -33,8 +33,14 @@ static const struct debug_named_value pco_debug_options[] = { PCO_DEBUG_INT_SMP, "Enable integer coordinate support for sampler instructions." }, { "global_shmem", - PCO_DEBUG_GLOBAL_SHMEM, - "Force spill shared memory to global memory." }, + PCO_DEBUG_GLOBAL_SHMEM, + "Force spill shared memory to global memory." }, + { "ra_force_spill", + PCO_DEBUG_RA_FORCE_SPILL, + "Force spilling of temps during register allocation." }, + { "ra_skip_opt", + PCO_DEBUG_RA_SKIP_OPT, + "Skip attempting to allocate temps with the optimal amount during RA." }, DEBUG_NAMED_VALUE_END, }; diff --git a/src/imagination/pco/pco_internal.h b/src/imagination/pco/pco_internal.h index edb669aff96..20a44a24f94 100644 --- a/src/imagination/pco/pco_internal.h +++ b/src/imagination/pco/pco_internal.h @@ -67,6 +67,8 @@ enum pco_debug { PCO_DEBUG_ALLOC_EXTRA_VTXINS = BITFIELD64_BIT(3), PCO_DEBUG_INT_SMP = BITFIELD64_BIT(4), PCO_DEBUG_GLOBAL_SHMEM = BITFIELD64_BIT(5), + PCO_DEBUG_RA_FORCE_SPILL = BITFIELD64_BIT(6), + PCO_DEBUG_RA_SKIP_OPT = BITFIELD64_BIT(7), }; extern uint64_t pco_debug; diff --git a/src/imagination/pco/pco_ra.c b/src/imagination/pco/pco_ra.c index 291c0dac97e..266984d681d 100644 --- a/src/imagination/pco/pco_ra.c +++ b/src/imagination/pco/pco_ra.c @@ -808,7 +808,7 @@ static bool pco_ra_func(pco_func *func, pco_ra_ctx *ctx) } bool allocated = ra_allocate(ra_graph); - bool force_spill = false; + bool force_spill = PCO_DEBUG(RA_FORCE_SPILL); if (!allocated || force_spill) { if (!ctx->spilling_setup) { ctx->spill_inst_addr_comps[0] = pco_ref_hwreg(0, PCO_REG_CLASS_TEMP); @@ -1181,7 +1181,6 @@ bool pco_ra(pco_shader *shader) shader->data.common.vtxins = MAX2(shader->data.common.vtxins, func->vtxins); } - shader->data.common.spilled_temps = ctx.spilled_temps; return progress; }