aco: fix Temp and assignment of renamed operands during RA
authorDaniel Schürmann <daniel@schuermann.dev>
Wed, 25 Mar 2020 11:15:54 +0000 (12:15 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Fri, 3 Apr 2020 22:13:15 +0000 (23:13 +0100)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002>

src/amd/compiler/aco_register_allocation.cpp

index 1a6775121fe90d9e797aa150af218e12f94d2372..9dad429134705412511ec5e3023067d32928ffa9 100644 (file)
@@ -1492,10 +1492,11 @@ void register_allocation(Program *program, std::vector<std::set<Temp>> live_out_
                   pc_op.setFixed(reg);
                   PhysReg new_reg = get_reg(ctx, register_file, operand.regClass(), parallelcopy, instr);
                   Definition pc_def = Definition(program->allocateId(), new_reg, pc_op.regClass());
-                  ctx.assignments[pc_def.tempId()] = {reg, pc_def.regClass()};
+                  ctx.assignments[pc_def.tempId()] = {new_reg, pc_def.regClass()};
                   register_file.clear(pc_op);
                   register_file.fill(pc_def);
                   parallelcopy.emplace_back(pc_op, pc_def);
+                  operand.setTemp(pc_def.getTemp());
                   operand.setFixed(new_reg);
                }