-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[InlineAsm] Steal a bit to denote a register is foldable #70738
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 all commits
Commits
Show all changes
4 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
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.
Does this require new MIR printer/parser support and corresponding tests?
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 a part of MIR I kind of curious about. Maybe you can double check my understanding?
(For the entire complete series I have locally) When I use
llc -stop-before
or-stop-after
to generate the starting point of a new MIR test,foldable
is printed as a comment, using my change toTargetInstrInfo::createMIROperandComment
below. Example:But if I use
llc -print-after-all
(or-print-after=finalize-isel
), it's printed via this method.(Note that the MachineOperand is a 32b immediate encoding an
InlineAsm::Flag
, hence the value1076101130
which we pretty print as$0:[regdef:GR32 spillable]
to be somewhat more understandable).So for the purposes of testing parsing MIR, I think the answer to the question of "does this need a parser test" is "no" because
foldable
is only ever printed inside a comment, which is what we'd need to be able to parse for MIR tests. IIUC, it seems the parser consumes the result ofTargetInstrInfo::createMIROperandComment
and notMachineInstr::print
as far as this is concerned (and that result is a comment).For the purposes of testing printing MIR, nothing will be setting this bit until the instruction selection frameworks later in the series. For those, I will add MIR tests that they use the above
MachineInstr::print
method to print, but IIUC it seems that you need to use-print-after
with a pass that sets this bit in order to observe the result of the above method.So can the printing test wait until then? Or is there some other way to provide code coverage of
MachineInstr::print
before then that I'm not thinking of? I could write a unittest if this is really necessary, but there doesn't seem to be much unittests for MIR.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 right, it doesn't require MIR testing. This is one of the areas where the debug output and MIR are not identical but ideally would be. The magic number with comments in inline asm operands are a pain point for MIR test maintenance