Skip to content

Commit 8dc64e9

Browse files
authored
llvm-reduce: Avoid double map lookup (#133447)
1 parent 6cc208c commit 8dc64e9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/tools/llvm-reduce/deltas/ReduceDIMetadata.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void identifyUninterestingMDNodes(Oracle &O, MDNodeList &MDs) {
3939
MDNode *MD = ToLook.back();
4040
ToLook.pop_back();
4141

42-
if (Visited.count(MD))
42+
if (!Visited.insert(MD))
4343
continue;
4444

4545
// Determine if the current MDNode is DebugInfo
@@ -55,8 +55,6 @@ void identifyUninterestingMDNodes(Oracle &O, MDNodeList &MDs) {
5555
for (Metadata *Op : MD->operands())
5656
if (MDNode *OMD = dyn_cast_or_null<MDNode>(Op))
5757
ToLook.push_back(OMD);
58-
59-
Visited.insert(MD);
6058
}
6159

6260
for (auto &T : Tuples) {

0 commit comments

Comments
 (0)