aco: don't use a scalar temporary for reductions on GFX10
[mesa.git] / src / amd / compiler / aco_lower_to_hw_instr.cpp
index 38e6030687bca242bd478cf85aeb3964fe8f0284..405961b1993ef80b6ed2db2a9671e6fb5a8e29c7 100644 (file)
@@ -481,8 +481,8 @@ void emit_reduction(lower_context *ctx, aco_opcode op, ReduceOp reduce_op, unsig
 
          if (cluster_size == 64) {
             for (unsigned i = 0; i < src.size(); i++)
-               bld.readlane(Definition(PhysReg{sitmp+i}, s1), Operand(PhysReg{tmp+i}, v1), Operand(31u));
-            emit_op(ctx, tmp, sitmp, tmp, vtmp, reduce_op, src.size());
+               bld.readlane(Definition(PhysReg{dst.physReg() + i}, s1), Operand(PhysReg{tmp+i}, v1), Operand(31u));
+            emit_op(ctx, tmp, dst.physReg(), tmp, vtmp, reduce_op, src.size());
          }
       } else if (cluster_size == 32) {
          for (unsigned i = 0; i < src.size(); i++)