From 2521c81c9e898b6785cb4fc069c329c42c2990c6 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 26 Feb 2020 22:45:28 +0100 Subject: [PATCH] aco: Minor optimization in spill_ctx constructor 'register_demand' is passed by value and only copied once; consider moving it to avoid unnecessary copies Reviewed-by: Rhys Perry Tested-by: Marge Bot Part-of: --- src/amd/compiler/aco_spill.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_spill.cpp b/src/amd/compiler/aco_spill.cpp index dfcdab2f003..f474685dbfe 100644 --- a/src/amd/compiler/aco_spill.cpp +++ b/src/amd/compiler/aco_spill.cpp @@ -65,7 +65,7 @@ struct spill_ctx { spill_ctx(const RegisterDemand target_pressure, Program* program, std::vector> register_demand) : target_pressure(target_pressure), program(program), - register_demand(register_demand), renames(program->blocks.size()), + register_demand(std::move(register_demand)), renames(program->blocks.size()), spills_entry(program->blocks.size()), spills_exit(program->blocks.size()), processed(program->blocks.size(), false), wave_size(program->wave_size) {} -- 2.30.2