aco: improve RA for uneven p_split_vector
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 27 Apr 2020 19:28:41 +0000 (20:28 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Apr 2020 23:16:55 +0000 (23:16 +0000)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4772>

src/amd/compiler/aco_register_allocation.cpp

index 42a4dcbcebff53314f98646b8cbab7298b20227d..e702e09059dcc06db9091ced8c6090c1660029fb 100644 (file)
@@ -1832,7 +1832,8 @@ void register_allocation(Program *program, std::vector<TempSet>& live_out_per_bl
                definition.setFixed(definition.physReg());
             else if (instr->opcode == aco_opcode::p_split_vector) {
                PhysReg reg = instr->operands[0].physReg();
-               reg.reg_b += i * definition.bytes();
+               for (unsigned j = 0; j < i; j++)
+                  reg.reg_b += instr->definitions[j].bytes();
                if (get_reg_specified(ctx, register_file, definition.regClass(), parallelcopy, instr, reg))
                   definition.setFixed(reg);
             } else if (instr->opcode == aco_opcode::p_wqm) {