aco/ra: copy vector_info to affinities
This eliminates some copies in BVH traversal loops. fossil-db (navi31): Totals from 200 (0.25% of 79825) affected shaders: Instrs: 734931 -> 732521 (-0.33%); split: -0.34%, +0.01% CodeSize: 3801080 -> 3791692 (-0.25%); split: -0.26%, +0.01% VGPRs: 13704 -> 13728 (+0.18%); split: -0.44%, +0.61% Latency: 6094605 -> 6082060 (-0.21%); split: -0.24%, +0.03% InvThroughput: 1081982 -> 1080121 (-0.17%); split: -0.19%, +0.02% VClause: 18835 -> 18837 (+0.01%); split: -0.01%, +0.02% Copies: 64602 -> 62239 (-3.66%); split: -3.75%, +0.09% Branches: 20111 -> 20112 (+0.00%); split: -0.01%, +0.02% VALU: 438618 -> 436257 (-0.54%); split: -0.55%, +0.01% SALU: 85092 -> 85085 (-0.01%); split: -0.01%, +0.00% VOPD: 76 -> 74 (-2.63%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Reviewed-by: Emre Cecanpunar <emreleno@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38695>
This commit is contained in:
@@ -3252,11 +3252,20 @@ get_affinities(ra_ctx& ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* create affinities */
|
||||
for (std::vector<Temp>& vec : phi_resources) {
|
||||
for (unsigned i = 1; i < vec.size(); i++)
|
||||
if (vec[i].id() != vec[0].id())
|
||||
ctx.assignments[vec[i].id()].affinity = vec[0].id();
|
||||
for (unsigned i = 1; i < vec.size(); i++) {
|
||||
if (vec[i].id() == vec[0].id())
|
||||
continue;
|
||||
|
||||
ctx.assignments[vec[i].id()].affinity = vec[0].id();
|
||||
|
||||
/* Propagate vector-info up the affinity-chain */
|
||||
auto it = ctx.vectors.find(vec[i].id());
|
||||
if (it != ctx.vectors.end() && !ctx.vectors.count(vec[0].id()))
|
||||
ctx.vectors[vec[0].id()] = it->second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user