-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix split barriers leaking during disjoint layout processing #11655
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a234d47
Fix split barriers leaking during disjoint layout processing
mtreinish bd9cdf5
Merge remote-tracking branch 'origin/main' into fix-barrier-split-leak
mtreinish 56d7d6a
Always use string uuid
mtreinish 02fd819
Merge remote-tracking branch 'origin/main' into fix-barrier-split-leak
mtreinish 43fb7d8
Add release note
mtreinish 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 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 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.
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.
Can we unconditionally string-ify the
UUID
here? The first branch does, the second doesn't, and it's technically breaking the typing assumptions ofInstruction.label
- it would be valid for a pass to examine the labels and assume that they should bestr | None
.As a follow-up: perhaps instead of the name mangling, we could return a
{new_label: old_label}
map from this function, which we then pass intocombine_barriers
so it can restore them? That has a side benefit of letting it be sure it only targetsBarrier
s that were split by this operation, without needing the"uuid=" in label or isinstance(label, UUID)
heuristic to guess.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.
Sure, I was using the
UUID
type here to differentiate between""
andNone
. But I can add a variant to the prefix to handle that.As for the follow-up about the return the issue is that
combine_barriers
isn't always called consistently through every call path. There are several paths where we still have split barriers that get processed in the layout pass and those could manually callcombine_barriers
(sabre does for example). We'd have to update all of those to work with this return type, but it's more of a risk regarding out of tree layout passes.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.
If there's multiple places that call these utilities, I think it's even more important that we have the re-combiner target specifically the desired barriers - it could be possible for a pass dependent or one of the places where we use an "inner" pass manager within a single pass to call the barrier splitter and recombiner while there are split barriers from the outer pass, which could desync the outer logic.
If backwards compatibility is a concern, we can leave this PR's logic in place in there's no dictionary given to the
combine_barriers
, but document that the argument always should be passed. If you want to do that in a follow-up, though, I'm ok with it.In fancier language, I think it's a liability for us to have non-reentrant logic in a utility function here, when we have in-tree places that call pass managers recursively.
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.
Sure, lets do it in a follow-up I'll open a tracking issue from your comments here,
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.
#11671