Skip to content

Commit 71a39ec

Browse files
[MLProgram] Avoid repeated hash lookups (NFC) (#108928)
1 parent 9825d1f commit 71a39ec

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mlir/lib/Dialect/MLProgram/Transforms/PipelineGlobalOps.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ LogicalResult MLProgramPipelineGlobals::buildGlobalMap(ModuleOp module) {
100100
for (size_t i = 0; i < work.size(); ++i) {
101101
callableMap[work[i]]->walk([&](CallOpInterface call) {
102102
auto symbol = dyn_cast<SymbolRefAttr>(call.getCallableForCallee());
103-
if (!visited.contains(symbol)) {
104-
visited.insert(symbol);
103+
if (visited.insert(symbol).second)
105104
work.push_back(symbol);
106-
}
107105
});
108106

109107
for (auto load : opLoadSymbols[work[i]])

0 commit comments

Comments
 (0)