-
Couldn't load subscription status.
- Fork 5.2k
JIT: Clean up 3-opt driver logic #112210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
JIT: Clean up 3-opt driver logic #112210
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what I want the hierarchy of 3-opt methods to look like:
ThreeOptLayout::Run: Set up some data structures, run 3-opt, and reorder the block listThreeOptLayout::RunThreeOpt: Run a 3-opt pass, and evaluate the new layout cost. TODO: If we want to try searching for a better local optimum, run another 3-opt pass with a different initial layout. I'd be surprised if this second pass makes a difference when we don't have loops, so a decent starting heuristic is to run another pass only when we have them. My current plan is to first run 3-opt withoutfgMoveHotJumpsrun on the initial layout, and then if we have loops, runfgMoveHotJumpson the initial layout, and try 3-opt again. We'll keep the better of the two.ThreeOptLayout::RunGreedyThreeOptPass: Actually run 3-opt until convergence on whatever initial layout we're given.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we saw with the
fgMoveHotJumpsdata, layout score better doesn't reflect everything we care about... any thoughts on how we might also assess the compactness of a layout?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this computation would only happen twice per compilation, I think we can implement a more sophisticated cost model using one of the techniques you mentioned in #112016 just for comparing candidate layouts, without it being too expensive. If we can't do that, then assuming 3-opt converges to the same cost with and without
fgMoveHotJumps, we could break ties by choosing the layout withfgMoveHotJumpsunder the assumption that it's more compact.