File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -454,7 +454,9 @@ void GenericCycleInfoCompute<ContextT>::dfs(BlockT *EntryBlock) {
454454 BlockT *Block = TraverseStack.back ();
455455 LLVM_DEBUG (errs () << " DFS visiting block: " << Info.Context .print (Block)
456456 << " \n " );
457- if (!BlockDFSInfo.count (Block)) {
457+ if (BlockDFSInfo.try_emplace (Block, Counter + 1 ).second ) {
458+ ++Counter;
459+
458460 // We're visiting the block for the first time. Open its DFSInfo, add
459461 // successors to the traversal stack, and remember the traversal stack
460462 // depth at which the block was opened, so that we can correctly record
@@ -465,9 +467,6 @@ void GenericCycleInfoCompute<ContextT>::dfs(BlockT *EntryBlock) {
465467 DFSTreeStack.emplace_back (TraverseStack.size ());
466468 llvm::append_range (TraverseStack, successors (Block));
467469
468- bool Added = BlockDFSInfo.try_emplace (Block, ++Counter).second ;
469- (void )Added;
470- assert (Added);
471470 BlockPreorder.push_back (Block);
472471 LLVM_DEBUG (errs () << " preorder number: " << Counter << " \n " );
473472 } else {
You can’t perform that action at this time.
0 commit comments