aco: remove some missing label resets
In the case of: c = xor(a, b) d = not(c) xor(d, e) it will be optimized to: d = xnor(a, b) xor(d, e) because "d" would still had a label with "instr=not(c)", it would then be further optimized to: d = xnor(a, b) xnor(c, e) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11309 Cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29650>
This commit is contained in:
@@ -2740,6 +2740,7 @@ combine_not_xor(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
||||
ctx.uses[instr->operands[0].tempId()]--;
|
||||
std::swap(instr->definitions[0], op_instr->definitions[0]);
|
||||
op_instr->opcode = aco_opcode::v_xnor_b32;
|
||||
ctx.info[op_instr->definitions[0].tempId()].label = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2965,6 +2966,7 @@ use_absdiff:
|
||||
std::swap(instr->definitions[0], op_instr->definitions[0]);
|
||||
std::swap(instr->definitions[1], op_instr->definitions[1]);
|
||||
ctx.uses[instr->operands[0].tempId()]--;
|
||||
ctx.info[op_instr->definitions[0].tempId()].label = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user