Module: Mesa
Branch: main
Commit: 6b5e9352ef7661670d9873e0cf96d6d5d2174c6f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b5e9352ef7661670d9873e0cf96d6d5d2174c6f

Author: Filip Gawin <[email protected]>
Date:   Thu Sep 16 20:50:29 2021 +0200

aco: cleanup assignment of unique_ptrs

Reviewed-by: Joshua Ashton <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12903>

---

 src/amd/compiler/aco_instruction_selection_setup.cpp |  2 +-
 src/amd/compiler/aco_optimizer.cpp                   | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection_setup.cpp 
b/src/amd/compiler/aco_instruction_selection_setup.cpp
index e9b333110d7..52980d36777 100644
--- a/src/amd/compiler/aco_instruction_selection_setup.cpp
+++ b/src/amd/compiler/aco_instruction_selection_setup.cpp
@@ -936,7 +936,7 @@ init_context(isel_context* ctx, nir_shader* shader)
    ctx->program->config->spi_ps_input_ena = spi_ps_inputs;
    ctx->program->config->spi_ps_input_addr = spi_ps_inputs;
 
-   ctx->cf_info.nir_to_aco.reset(nir_to_aco.release());
+   ctx->cf_info.nir_to_aco = std::move(nir_to_aco);
 
    /* align and copy constant data */
    while (ctx->program->constant_data.size() % 4u)
diff --git a/src/amd/compiler/aco_optimizer.cpp 
b/src/amd/compiler/aco_optimizer.cpp
index 933d56894bf..dd04b3584d6 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -3139,7 +3139,7 @@ combine_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr)
       fma->neg_lo[1] = fma->neg_lo[1] ^ vop3p->neg_lo[1 - add_op_idx];
       fma->neg_hi[1] = fma->neg_hi[1] ^ vop3p->neg_hi[1 - add_op_idx];
       fma->definitions[0] = instr->definitions[0];
-      instr.reset(fma.release());
+      instr = std::move(fma);
       ctx.info[instr->definitions[0].tempId()].set_vop3p(instr.get());
       return;
    }
@@ -3361,7 +3361,7 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& 
instr)
          /* mark this ssa_def to be re-checked for profitability and literals 
*/
          ctx.mad_infos.emplace_back(std::move(instr), 
mul_instr->definitions[0].tempId());
          ctx.info[mad->definitions[0].tempId()].set_mad(mad.get(), 
ctx.mad_infos.size() - 1);
-         instr.reset(mad.release());
+         instr = std::move(mad);
          return;
       }
    }
@@ -3380,7 +3380,7 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& 
instr)
             new_instr->operands[1] = instr->operands[!i];
             new_instr->operands[2] = 
Operand(ctx.info[instr->operands[i].tempId()].temp);
             new_instr->definitions[0] = instr->definitions[0];
-            instr.reset(new_instr.release());
+            instr = std::move(new_instr);
             ctx.info[instr->definitions[0].tempId()].label = 0;
             return;
          }
@@ -3579,7 +3579,7 @@ select_instruction(opt_ctx& ctx, aco_ptr<Instruction>& 
instr)
                aco_opcode::p_create_vector, Format::PSEUDO, 1, 1)};
             extract->operands[0] = op;
             extract->definitions[0] = instr->definitions[idx];
-            instr.reset(extract.release());
+            instr = std::move(extract);
 
             done = true;
          }
@@ -3594,7 +3594,7 @@ select_instruction(opt_ctx& ctx, aco_ptr<Instruction>& 
instr)
          extract->operands[1] =
             Operand::c32((uint32_t)split_offset / 
instr->definitions[idx].bytes());
          extract->definitions[0] = instr->definitions[idx];
-         instr.reset(extract.release());
+         instr = std::move(extract);
       }
    }
 

Reply via email to