X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Famd%2Fcompiler%2Faco_spill.cpp;h=56167e36d6d4fbe279169a12483701e6d49960bd;hb=08d510010b7586387e363460b98e6a45bbe97164;hp=92a23bb355c7cc82c69ecc8045160199a95b279b;hpb=7453c1adff9d8a9e09cd7585e05c4db1c70870be;p=mesa.git diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index 92a23bb355c..56167e36d6d 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -1568,8 +1568,6 @@ void spill(Program* program, live& live_vars, const struct radv_nir_compiler_opt return; /* else, we check if we can improve things a bit */ - uint16_t total_sgpr_regs = options->chip_class >= GFX8 ? 800 : 512; - uint16_t max_addressible_sgpr = program->sgpr_limit; /* calculate target register demand */ RegisterDemand max_reg_demand; @@ -1577,14 +1575,14 @@ void spill(Program* program, live& live_vars, const struct radv_nir_compiler_opt max_reg_demand.update(block.register_demand); } - RegisterDemand target_pressure = {256, int16_t(max_addressible_sgpr)}; + RegisterDemand target_pressure = {256, int16_t(program->sgpr_limit)}; unsigned num_waves = 1; - int spills_to_vgpr = (max_reg_demand.sgpr - max_addressible_sgpr + 63) / 64; + int spills_to_vgpr = (max_reg_demand.sgpr - program->sgpr_limit + 63) / 64; /* test if it possible to increase occupancy with little spilling */ for (unsigned num_waves_next = 2; num_waves_next <= 8; num_waves_next++) { RegisterDemand target_pressure_next = {int16_t((256 / num_waves_next) & ~3), - int16_t(std::min(((total_sgpr_regs / num_waves_next) & ~7) - 2, max_addressible_sgpr))}; + int16_t(get_addr_sgpr_from_waves(program, num_waves_next))}; /* Currently no vgpr spilling supported. * Spill as many sgprs as necessary to not hinder occupancy */