-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MachineScheduler][NFCI] Add Offset and OffsetIsScalable args to shouldClusterMemOps #73778
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
asb
merged 6 commits into
llvm:main
from
asb:2023q4-cleanup-add-offset-to-shouldclustermemops
Dec 6, 2023
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ecc1ca6
[MachineScheduler][NFCI] Add Offset and OffsetIsScalable args to shou…
asb 5a1d0a9
Add missing doc comment change
asb 2cada4e
Note that Offset2 will never be less than Offset1
asb 3b552e8
Actually Offset2 may be less than Offset1
asb 6083ea3
Add FIXME about moving to something ElementCount-style
asb 178c0d2
Avoid warning about OffsetIsScalable being initialised before Width
asb 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
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
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
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
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
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
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.
How about using one parameter of type ElementCount for each pair of parameters (int,bool)? So that the signature simplifies to:
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.
Looking at ElementCount, I'm not sure it's semantically the right abstraction? e.g. for
LW %0:gpr, 12
we'd be passingOffset1=12
andOffsetIsScalable1=false
.ElementCount
doesn't seem right for representing that.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.
The docs for ElementCount are a bit confusingly worded, but I think this is the right abstraction here. An Offset1=12 and OffsetIsScalable1=false would be a ElementCount::getFixed(12).
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.
Is ElementCount able to represent a negative offset or large offsets? The current signature uses int64_t. I believe ElementCount is
unsigned
and abool
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.
That is a good point. I don't think ElementCount can be negative. We could either introduce a new subclass of FixedOrScalableQuantity, or just go with what @asb proposed.
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.
Oh right - we do not have an abstraction for negative scalable values. It would be ideal though, I can see
OffsetInBytes
derived fromFixedOrScalableQuantity
being useful in other places. I won't hold your work here - please go ahead with your code, we can fix it later if needed.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.
Thank you all, and sorry for not understanding the suggestion at first Francesco. The docs for ElementCount indeed weren't clear to me.
I've added a FIXME note that moving to a new abstraction would be better. Would you be happy for me to land this PR as-is? I'm not opposed to looking to introduce this new abstraction, but if that's your desired route would appreciate some pointers to where else it might be used.
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.
I suspect that the whole class StackOffset could be converted to what we need here, but it can be done later.