Skip to content

Commit 523cd8c

Browse files
aparshin-inteligcbot
authored andcommitted
replace map to unordered_map in VisaRegalloc
cosmetics, small optimization
1 parent 485dacb commit 523cd8c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXVisaRegAlloc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ GenXVisaRegAlloc::Reg* GenXVisaRegAlloc::getRegForValueUntyped(const Function *k
631631
if (RegMap.count(kernel) == 0)
632632
return nullptr;
633633
auto& KernMap = RegMap.at(kernel);
634-
KernRegMap_t::const_iterator i = KernMap.find(V);
634+
const auto i = KernMap.find(V);
635635
if (i == KernMap.end()) {
636636
// Check if it's predefined variables.
637637
if (GenXIntrinsic::getGenXIntrinsicID(V.getValue()) ==

IGC/VectorCompiler/lib/GenXCodeGen/GenXVisaRegAlloc.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ SPDX-License-Identifier: MIT
5252
#include <map>
5353
#include <string>
5454
#include <vector>
55+
#include <unordered_map>
5556

5657
namespace llvm {
5758

@@ -89,7 +90,7 @@ namespace llvm {
8990
std::vector<std::pair<unsigned, std::string>> Attributes;
9091
// Pointer to VISA variable. It is set by CisaBuilder when it creates
9192
// VISA variables for all registers in RegMap.
92-
std::map<VISAKernel*, void*> GenVar;
93+
std::unordered_map<VISAKernel*, void*> GenVar;
9394

9495
explicit Reg(
9596
unsigned Category,
@@ -128,7 +129,7 @@ namespace llvm {
128129

129130
using RegPushHook = void(*)(void* Object, Reg&);
130131
using KernRegMap_t = std::map<genx::SimpleValue, Reg*>;
131-
using RegMap_t = std::map<const Function*, KernRegMap_t>;
132+
using RegMap_t = std::unordered_map<const Function*, KernRegMap_t>;
132133
using LRPtrVect = std::vector<genx::LiveRange *>;
133134
using LRCPtrVect = std::vector<const genx::LiveRange *>;
134135

0 commit comments

Comments
 (0)