Skip to content

[Hexagon] Avoid repeated hash lookups (NFC) #107760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,7 @@ LaneBitmask HexagonExpandCondsets::getLaneMask(Register Reg, unsigned Sub) {
void HexagonExpandCondsets::addRefToMap(RegisterRef RR, ReferenceMap &Map,
unsigned Exec) {
unsigned Mask = getMaskForSub(RR.Sub) | Exec;
ReferenceMap::iterator F = Map.find(RR.Reg);
if (F == Map.end())
Map.insert(std::make_pair(RR.Reg, Mask));
else
F->second |= Mask;
Map[RR.Reg] |= Mask;
}

bool HexagonExpandCondsets::isRefInMap(RegisterRef RR, ReferenceMap &Map,
Expand Down
6 changes: 1 addition & 5 deletions llvm/lib/Target/Hexagon/HexagonTfrCleanup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,7 @@ bool HexagonTfrCleanup::isIntReg(unsigned Reg, bool &Is32) {
// Assign given value V32 to the specified the register R32 in the map. Only
// 32-bit registers are valid arguments.
void HexagonTfrCleanup::setReg(unsigned R32, uint32_t V32, ImmediateMap &IMap) {
ImmediateMap::iterator F = IMap.find(R32);
if (F == IMap.end())
IMap.insert(std::make_pair(R32, V32));
else
F->second = V32;
IMap[R32] = V32;
}

// Retrieve a value of the provided register Reg and store it into Val.
Expand Down
Loading