-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[GlobalISel] Document minimum legality requirements for G_IMPLICIT_DEF. #117609
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
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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.
That could create illegal MIR after the legalizer. Please tell me when you finished inspecting all downstream legalizers.
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.
So two things 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.
The AArch64 legalizer disagrees/is nonconforming.
I see the legalizer as the ground-truth for legality questions. I prefer to query the legalizer and not enforce rules on the legalizer.
I don't see any benefit of this change. It makes the state worth. It gives you an escape-hatch that you don't have to query the legalizer in some situations.
All non-Apple:-)
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 it requires no code to be selected.is not really true. G_IMPLICIT_DEF should select to IMPLICIT_DEF.My concern was reliance on introduction of new G_IMPLICIT_DEFs in the artifact combiner, such that not having a legal option could fail. I'm not actually seeing where that might happen.
However targets are doing a disservice to themselves by not having G_IMPLICIT_DEF as legal for every possible register type. I know SelectionDAG has an anti-feature that I've run into before where the default expansion of UNDEF turns into a zero
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.
llvm-project/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
Line 95 in bb88fd1
G_IMPLICIT_DEF is not legal for scalable vectors!
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.
Which should be considered a target bug. In 100% of situations this should select to IMPLICIT_DEF
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 am more worried about illegal MIR than how hard it is to select G_IMPLICIT_DEF.
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.
You're welcome to see things how you like. That has no relation to reality however.
That sounds like something we should fix at some point. Were you under the impression that scalable vector support was complete?
We are clarifying the definition what is assumed to be legal, and therefore it is not illegal MIR. Any complaints about illegal MIR are therefore bugs or missing support in the target implementation.
Are we clear now?