Skip to content

Commit f5b7c10

Browse files
[Hexagon] Avoid repeated hash lookups (NFC) (#107760)
1 parent bdb6f1b commit f5b7c10

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,7 @@ LaneBitmask HexagonExpandCondsets::getLaneMask(Register Reg, unsigned Sub) {
297297
void HexagonExpandCondsets::addRefToMap(RegisterRef RR, ReferenceMap &Map,
298298
unsigned Exec) {
299299
unsigned Mask = getMaskForSub(RR.Sub) | Exec;
300-
ReferenceMap::iterator F = Map.find(RR.Reg);
301-
if (F == Map.end())
302-
Map.insert(std::make_pair(RR.Reg, Mask));
303-
else
304-
F->second |= Mask;
300+
Map[RR.Reg] |= Mask;
305301
}
306302

307303
bool HexagonExpandCondsets::isRefInMap(RegisterRef RR, ReferenceMap &Map,

llvm/lib/Target/Hexagon/HexagonTfrCleanup.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ bool HexagonTfrCleanup::isIntReg(unsigned Reg, bool &Is32) {
9292
// Assign given value V32 to the specified the register R32 in the map. Only
9393
// 32-bit registers are valid arguments.
9494
void HexagonTfrCleanup::setReg(unsigned R32, uint32_t V32, ImmediateMap &IMap) {
95-
ImmediateMap::iterator F = IMap.find(R32);
96-
if (F == IMap.end())
97-
IMap.insert(std::make_pair(R32, V32));
98-
else
99-
F->second = V32;
95+
IMap[R32] = V32;
10096
}
10197

10298
// Retrieve a value of the provided register Reg and store it into Val.

0 commit comments

Comments
 (0)