aco/ra: don't reallocate VOP3 instruction for non-vcc lane mask
authorGeorg Lehmann <dadschoorse@gmail.com>
Wed, 29 Mar 2023 15:59:15 +0000 (17:59 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 30 Mar 2023 03:34:34 +0000 (03:34 +0000)
This would need to copy opsel soon but we can just reuse the old instruction.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22069>

src/amd/compiler/aco_register_allocation.cpp

index 7ffbf93..8c6a6a7 100644 (file)
@@ -3120,12 +3120,7 @@ register_allocation(Program* program, std::vector<IDSet>& live_out_per_block, ra
             }
 
             /* change the instruction to VOP3 to enable an arbitrary register pair as dst */
-            aco_ptr<Instruction> tmp = std::move(instr);
-            Format format = asVOP3(tmp->format);
-            instr.reset(create_instruction<VALU_instruction>(
-               tmp->opcode, format, tmp->operands.size(), tmp->definitions.size()));
-            std::copy(tmp->operands.begin(), tmp->operands.end(), instr->operands.begin());
-            std::copy(tmp->definitions.begin(), tmp->definitions.end(), instr->definitions.begin());
+            instr->format = asVOP3(instr->format);
          }
 
          instructions.emplace_back(std::move(*instr_it));