Skip to content

Commit db32924

Browse files
[HipStdPar] Avoid repeated hash lookups (NFC) (#112653)
1 parent 9548366 commit db32924

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Transforms/HipStdPar/HipStdPar.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,13 @@ static inline bool checkIfSupported(GlobalVariable &G) {
8686
auto U = std::move(Tmp.back());
8787
Tmp.pop_back();
8888

89-
if (Visited.contains(U))
89+
if (!Visited.insert(U).second)
9090
continue;
9191

9292
if (isa<Instruction>(U))
9393
I = cast<Instruction>(U);
9494
else
9595
Tmp.insert(Tmp.end(), U->user_begin(), U->user_end());
96-
97-
Visited.insert(U);
9896
} while (!I && !Tmp.empty());
9997

10098
assert(I && "thread_local global should have at least one non-constant use.");

0 commit comments

Comments
 (0)