aco: Minor optimization in spill_ctx constructor
authorAlbert Astals Cid <aacid@kde.org>
Wed, 26 Feb 2020 21:45:28 +0000 (22:45 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 2 Mar 2020 12:21:03 +0000 (12:21 +0000)
'register_demand' is passed by value and only copied once; consider moving it to avoid unnecessary copies

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

src/amd/compiler/aco_spill.cpp

index dfcdab2f003e6221d88d3af2369d9cd20d8ff5c2..f474685dbfe8f47ded3d3b0f0b6a90df59ecacd0 100644 (file)
@@ -65,7 +65,7 @@ struct spill_ctx {
    spill_ctx(const RegisterDemand target_pressure, Program* program,
              std::vector<std::vector<RegisterDemand>> 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) {}