mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 12:08:06 +02:00
aco: be more careful with literals in combine_salu_{n2,lshl_add}
No pipeline-db changes. Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2883>
This commit is contained in:
parent
fcf52eb42d
commit
dc6c35e1c3
1 changed files with 8 additions and 0 deletions
|
|
@ -1678,6 +1678,10 @@ bool combine_salu_n2(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
if (!op2_instr || (op2_instr->opcode != aco_opcode::s_not_b32 && op2_instr->opcode != aco_opcode::s_not_b64))
|
||||
continue;
|
||||
|
||||
if (instr->operands[!i].isLiteral() && op2_instr->operands[0].isLiteral() &&
|
||||
instr->operands[!i].constantValue() != op2_instr->operands[0].constantValue())
|
||||
continue;
|
||||
|
||||
ctx.uses[instr->operands[i].tempId()]--;
|
||||
instr->operands[0] = instr->operands[!i];
|
||||
instr->operands[1] = op2_instr->operands[0];
|
||||
|
|
@ -1720,6 +1724,10 @@ bool combine_salu_lshl_add(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
if (shift < 1 || shift > 4)
|
||||
continue;
|
||||
|
||||
if (instr->operands[!i].isLiteral() && op2_instr->operands[0].isLiteral() &&
|
||||
instr->operands[!i].constantValue() != op2_instr->operands[0].constantValue())
|
||||
continue;
|
||||
|
||||
ctx.uses[instr->operands[i].tempId()]--;
|
||||
instr->operands[1] = instr->operands[!i];
|
||||
instr->operands[0] = op2_instr->operands[0];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue