From: Juan A. Suarez Romero Date: Tue, 8 Nov 2016 10:59:44 +0000 (+0100) Subject: i965/vec4: skip registers already marked as no_spill X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b9a9a0c5d5feb231855910abf99839a6236f6db;p=mesa.git i965/vec4: skip registers already marked as no_spill Do not evaluate spill costs for registers that were already marked as no_spill. Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp index 228e04c44de..5a5be857514 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp @@ -385,7 +385,7 @@ vec4_visitor::evaluate_spill_costs(float *spill_costs, bool *no_spill) */ foreach_block_and_inst(block, vec4_instruction, inst, cfg) { for (unsigned int i = 0; i < 3; i++) { - if (inst->src[i].file == VGRF) { + if (inst->src[i].file == VGRF && !no_spill[inst->src[i].nr]) { /* We will only unspill src[i] it it wasn't unspilled for the * previous instruction, in which case we'll just reuse the scratch * reg for this instruction. @@ -399,7 +399,7 @@ vec4_visitor::evaluate_spill_costs(float *spill_costs, bool *no_spill) } } - if (inst->dst.file == VGRF) { + if (inst->dst.file == VGRF && !no_spill[inst->dst.nr]) { spill_costs[inst->dst.nr] += loop_scale; if (inst->dst.reladdr || inst->dst.offset % REG_SIZE != 0) no_spill[inst->dst.nr] = true;