Simplify ChildrenGetter to a simple wrapper around a GraphDiff call.
GraphDiff already handles nullptr in children, so the special casing in
clang can also be removed.
Details
- Reviewers
kuhar dblaikie - Commits
- rGe22de4e46d1d: [DominatorTree] Simplify ChildrenGetter.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM.
One tiny nit: the function name ChildrenGet sounds kind of backwards to me, but it seems like the other direction is already taken.
If there are both "ChildrenGet" and "GetChildren" in the same scope, seems like we probably should address that rather than having one awkwardly named & the ensuing lack of clarity.
Renamed ChildrenGet to getChildren. The same name only exists in GraphDiff, it's ok to keep a consistent naming.
This change had a significant negative compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=0b161def6cacff1a63d3cf1a1efe95b550814d7a&to=e22de4e46d1dd1aacc3a7060d24bcbe89908ba6c&stat=instructions
I'm looking into it. If needed this can be reverted as it's not blocking the work for DomTree updates with a CFGView.
The regression here seems to be because operations on an empty GraphDiff don't optimize out. Not going through GraphDiff but using the same basic logic (https://github.com/llvm/llvm-project/commit/4c6a5de8131183ff88f52cc3dda67180e31501a1 -- going through a separate method seems to be necessary for NRVO) we get back at least part of it: https://llvm-compile-time-tracker.com/compare.php?from=38537307e502c1ac9a09e6f75f9208db1327a0bf&to=4c6a5de8131183ff88f52cc3dda67180e31501a1&stat=instructions