JIT: Use postorder numbers as keys into ordinals in 3-opt layout #110922
+52
−32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now that most
fgRenumberBlocks
calls are gone,bbNum
-indexed arrays are likely to be quite sparse by the time we get to the backend. Using postorder numbers in lieu ofbbNum
during block layout is more efficient; to do this, we have to keep references to the initial RPO traversal around throughout the phase, though these data structures might be useful for influencing future decisions 3-opt may make as we expand its capabilities.This change was motivated by my efforts to support dumping CFG data that can be consumed by external TSP optimizers -- the one I'm considering requires nodes to be numbered with contiguous indices, which postorder numbers are good for.