This is an archive of the discontinued LLVM Phabricator instance.

[DominatorTree] Simplify ChildrenGetter.
ClosedPublic

Authored by asbirlea on Jul 27 2020, 4:43 PM.

Details

Summary

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.

Diff Detail

Event Timeline

asbirlea created this revision.Jul 27 2020, 4:43 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 27 2020, 4:43 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
kuhar accepted this revision.Jul 27 2020, 5:28 PM

LGTM.

One tiny nit: the function name ChildrenGet sounds kind of backwards to me, but it seems like the other direction is already taken.

This revision is now accepted and ready to land.Jul 27 2020, 5:28 PM

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.

asbirlea updated this revision to Diff 281382.Jul 28 2020, 3:33 PM

Renamed ChildrenGet to getChildren. The same name only exists in GraphDiff, it's ok to keep a consistent naming.

kuhar accepted this revision.Jul 28 2020, 3:34 PM
This revision was landed with ongoing or failed builds.Jul 28 2020, 3:45 PM
This revision was automatically updated to reflect the committed changes.

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