Skip to content

Commit f355a44

Browse files
[HipStdPar] Avoid repeated hash lookups (NFC) (#123558)
1 parent bc1e699 commit f355a44

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/HipStdPar/HipStdPar.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ HipStdParAllocationInterpositionPass::run(Module &M, ModuleAnalysisManager&) {
279279
for (auto &&F : M) {
280280
if (!F.hasName())
281281
continue;
282-
if (!AllocReplacements.contains(F.getName()))
282+
auto It = AllocReplacements.find(F.getName());
283+
if (It == AllocReplacements.end())
283284
continue;
284285

285-
if (auto R = M.getFunction(AllocReplacements[F.getName()])) {
286+
if (auto R = M.getFunction(It->second)) {
286287
F.replaceAllUsesWith(R);
287288
} else {
288289
std::string W;

0 commit comments

Comments
 (0)