As we discussed on IRC a couple of days ago, we want to speed up some skip checks in LCSSA, and we need to walk the BB of a loop in BFS order to do so.
I decided to make this a piece of ADT, just in case we need for something else. I'll add some other tests and give some testing, but I want to make sure we agree it's fine having this being a generic iterator.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I'm trying to understand how you are level numbering.
The level numbering can't be done on a cyclic graph without help (or, at the very least, if it is defined as "the minimum depth from root we ever saw this node as" or sometihng, so you would use min(current, last level)".
It works fine for free.
Comment Actions
Forget it, i'm being dumb.
It's unweighted bfs, so if there was a shorter path, we would have already hit it, so if we revisit something, it can't change the lowest level.
Comment Actions
- Updated test to be more comprehensive
- Add a test with a cyclic graph
- Fixed a bug in the marker logic where we were looping indefinitely (now covered by testing).
I think this is ready to be used in LCSSA now.
Comment Actions
Also, I added some comments to explain how we put the markers, but please let me know if I'm missing something