This is an archive of the discontinued LLVM Phabricator instance.

DomTree: Add climbLhsUntilSiblings helper
AcceptedPublic

Authored by nhaehnle on Jul 2 2020, 2:09 PM.

Details

Summary

Change-Id: I0f756786e14ef6228d0275e69d94eb8d7460d94b

Diff Detail

Event Timeline

nhaehnle created this revision.Jul 2 2020, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2020, 2:09 PM
arsenm added inline comments.Jul 3 2020, 8:16 AM
llvm/lib/Support/GenericDomTree.cpp
217–219

Should go in header?

220

I'm not sure these are the right family analogies. This could also find a great uncle, or the same parent.

nhaehnle marked an inline comment as done.Jul 6 2020, 7:22 AM
nhaehnle added inline comments.
llvm/lib/Support/GenericDomTree.cpp
220

Fair enough, do you have a suggestion for a better name? findSiblingOfNthUncle perhaps?

arsenm added inline comments.Jul 6 2020, 1:17 PM
llvm/lib/Support/GenericDomTree.cpp
220

I don't really have a better idea. The comment could maybe explain more of the cases it can encounter? "some ancestor" is a bit vague.

kuhar requested changes to this revision.Jul 6 2020, 7:52 PM
kuhar added a subscriber: kuhar.
kuhar added inline comments.
llvm/lib/Support/GenericDomTree.cpp
220

I agree with arsenm, the naming is unfortunate. Maybe climbUntilSiblings?

Whatever name we settle on here, I think an ascii art with an example would really help here.

This revision now requires changes to proceed.Jul 6 2020, 7:52 PM
nhaehnle updated this revision to Diff 280483.Jul 24 2020, 9:13 AM
v6:
- rename to climbLhsUntilSiblings and add some explanatory ASCII art
  and comments for why this operation could be interesting
nhaehnle retitled this revision from DomTree: Add findSiblingOfUncle helper to DomTree: Add climbLhsUntilSiblings helper.Jul 24 2020, 9:14 AM
arsenm accepted this revision.Jul 27 2020, 3:37 PM
kuhar accepted this revision.Jul 27 2020, 5:33 PM
This revision is now accepted and ready to land.Jul 27 2020, 5:33 PM
kuhar resigned from this revision.May 16 2022, 10:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2022, 10:58 AM