aco: follow through temporary when merging tests into constant comparisons
[mesa.git] / src / amd / compiler / aco_optimizer.cpp
index 61cb58df1726946ced9b3f200a2f231fa8638180..8406a9168e0778a115bf891075eca85e6dbb500d 100644 (file)
@@ -1394,7 +1394,8 @@ bool combine_constant_comparison_ordering(opt_ctx &ctx, aco_ptr<Instruction>& in
    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;