aco: use vcc for 64-bit vgpr addition
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 9 Mar 2021 16:40:23 +0000 (16:40 +0000)
committerMarge Bot <emma+marge@anholt.net>
Wed, 13 Apr 2022 16:23:35 +0000 (16:23 +0000)
fossil-db (Sienna Cichlid):
Totals from 229 (0.17% of 134621) affected shaders:
CodeSize: 1520192 -> 1517644 (-0.17%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14124>

src/amd/compiler/aco_optimizer.cpp

index b0d087743790bf22c1988898c1a43d971899285c..b55d64d3772064dc89a85e3af3b208f422ed07d3 100644 (file)
@@ -1745,6 +1745,7 @@ label_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
 
       ctx.info[instr->operands[2].tempId()].set_vcc_hint();
       break;
+   case aco_opcode::v_addc_co_u32: ctx.info[instr->operands[2].tempId()].set_vcc_hint(); break;
    case aco_opcode::v_cmp_lg_u32:
       if (instr->format == Format::VOPC && /* don't optimize VOP3 / SDWA / DPP */
           instr->operands[0].constantEquals(0) && instr->operands[1].isTemp() &&
@@ -3675,8 +3676,9 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
        instr->opcode != aco_opcode::v_fma_mixlo_f16)
       return combine_vop3p(ctx, instr);
 
-   if (ctx.info[instr->definitions[0].tempId()].is_vcc_hint()) {
-      instr->definitions[0].setHint(vcc);
+   for (Definition& def : instr->definitions) {
+      if (ctx.info[def.tempId()].is_vcc_hint())
+         def.setHint(vcc);
    }
 
    if (instr->isSDWA() || instr->isDPP())