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) {
454
454
BlockT *Block = TraverseStack.back ();
455
455
LLVM_DEBUG (errs () << " DFS visiting block: " << Info.Context .print (Block)
456
456
<< " \n " );
457
- if (!BlockDFSInfo.count (Block)) {
457
+ if (BlockDFSInfo.try_emplace (Block, Counter + 1 ).second ) {
458
+ ++Counter;
459
+
458
460
// We're visiting the block for the first time. Open its DFSInfo, add
459
461
// successors to the traversal stack, and remember the traversal stack
460
462
// depth at which the block was opened, so that we can correctly record
@@ -465,9 +467,6 @@ void GenericCycleInfoCompute<ContextT>::dfs(BlockT *EntryBlock) {
465
467
DFSTreeStack.emplace_back (TraverseStack.size ());
466
468
llvm::append_range (TraverseStack, successors (Block));
467
469
468
- bool Added = BlockDFSInfo.try_emplace (Block, ++Counter).second ;
469
- (void )Added;
470
- assert (Added);
471
470
BlockPreorder.push_back (Block);
472
471
LLVM_DEBUG (errs () << " preorder number: " << Counter << " \n " );
473
472
} else {
You can’t perform that action at this time.
0 commit comments