if (cmp->operands[constant_operand].isConstant()) {
constant = cmp->operands[constant_operand].constantValue();
} else if (cmp->operands[constant_operand].isTemp()) {
- unsigned id = cmp->operands[constant_operand].tempId();
+ Temp tmp = cmp->operands[constant_operand].getTemp();
+ unsigned id = original_temp_id(ctx, tmp);
if (!ctx.info[id].is_constant() && !ctx.info[id].is_literal())
return false;
constant = ctx.info[id].val;
/* Applying two sgprs require making it VOP3, so don't do it unless it's
* definitively beneficial.
* TODO: this is too conservative because later the use count could be reduced to 1 */
- if (num_sgprs && ctx.uses[sgpr_info_id] > 1)
+ if (num_sgprs && ctx.uses[sgpr_info_id] > 1 && !instr->isVOP3())
break;
Temp sgpr = ctx.info[sgpr_info_id].temp;
sgpr_ids[num_sgprs++] = sgpr.id();
ctx.uses[sgpr_info_id]--;
ctx.uses[sgpr.id()]++;
-
- break; /* for testing purposes, only apply 1 new sgpr */
}
}