aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorAlbert Astals Cid <[email protected]>2020-02-25 00:49:01 +0100
committerMarge Bot <[email protected]>2020-03-02 13:18:49 +0000
commit760fe44e8c09e533fb96d327e658aea4bfe3c883 (patch)
tree0d0d08c60d44840b84caafcd835ba4c9d0cba444 /src/amd
parent5469221e77bd6baf1dfe4a6c1c0149223bf2f890 (diff)
aco: pass vars by const &
Reviewed-by: Rhys Perry <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3935> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3935>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/compiler/aco_register_allocation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index d43806e9bad..e8b1069a509 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -313,7 +313,7 @@ std::pair<PhysReg, bool> get_reg_simple(ra_ctx& ctx,
bool get_regs_for_copies(ra_ctx& ctx,
RegisterFile& reg_file,
std::vector<std::pair<Operand, Definition>>& parallelcopies,
- std::set<std::pair<unsigned, unsigned>> vars,
+ const std::set<std::pair<unsigned, unsigned>> &vars,
uint32_t lb, uint32_t ub,
aco_ptr<Instruction>& instr,
uint32_t def_reg_lo,
@@ -322,7 +322,7 @@ bool get_regs_for_copies(ra_ctx& ctx,
/* variables are sorted from small sized to large */
/* NOTE: variables are also sorted by ID. this only affects a very small number of shaders slightly though. */
- for (std::set<std::pair<unsigned, unsigned>>::reverse_iterator it = vars.rbegin(); it != vars.rend(); ++it) {
+ for (std::set<std::pair<unsigned, unsigned>>::const_reverse_iterator it = vars.rbegin(); it != vars.rend(); ++it) {
unsigned id = it->second;
std::pair<PhysReg, RegClass> var = ctx.assignments[id];
uint32_t size = it->first;