aco: use unordered_set for spill id interferences
authorRhys Perry <pendingchaos02@gmail.com>
Tue, 7 Jul 2020 12:11:07 +0000 (13:11 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 16 Jul 2020 16:22:57 +0000 (16:22 +0000)
Seems to be faster.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5805>

src/amd/compiler/aco_spill.cpp

index faba524b76d6fea4f03676293dd1e1f764f3390a..f1199cc3ae2a1fa9d3906474ca292c9069699429 100644 (file)
@@ -56,7 +56,7 @@ struct spill_ctx {
    std::stack<Block*> loop_header;
    std::vector<std::map<Temp, std::pair<uint32_t, uint32_t>>> next_use_distances_start;
    std::vector<std::map<Temp, std::pair<uint32_t, uint32_t>>> next_use_distances_end;
-   std::vector<std::pair<RegClass, std::set<uint32_t>>> interferences;
+   std::vector<std::pair<RegClass, std::unordered_set<uint32_t>>> interferences;
    std::vector<std::vector<uint32_t>> affinities;
    std::vector<bool> is_reloaded;
    std::map<Temp, remat_info> remat;
@@ -100,7 +100,7 @@ struct spill_ctx {
 
    uint32_t allocate_spill_id(RegClass rc)
    {
-      interferences.emplace_back(rc, std::set<uint32_t>());
+      interferences.emplace_back(rc, std::unordered_set<uint32_t>());
       is_reloaded.push_back(false);
       return next_spill_id++;
    }