Skip to content

Commit cfad8bf

Browse files
committed
[DomTree] Remove unnecessary check (NFC)
ReverseChildren is populated during runDFS() with reachable nodes only. This check dates back to a time when this code used inverse_children<> directly, which could indeed contain unreachable nodes.
1 parent 2fb51fb commit cfad8bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/include/llvm/Support/GenericDomTreeConstruction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ struct SemiNCAInfo {
286286
// Initialize the semi dominator to point to the parent node.
287287
WInfo.Semi = WInfo.Parent;
288288
for (const auto &N : WInfo.ReverseChildren) {
289-
if (NodeToInfo.count(N) == 0) // Skip unreachable predecessors.
290-
continue;
289+
assert(NodeToInfo.contains(N) &&
290+
"ReverseChildren should not contain unreachable predecessors");
291291

292292
const TreeNodePtr TN = DT.getNode(N);
293293
// Skip predecessors whose level is above the subtree we are processing.

0 commit comments

Comments
 (0)