-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[ADT] Fix specialization of ValueIsPresent for PointerUnion #121847
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
8 commits
Select commit
Hold shift + click to select a range
107a35d
[ADT] Make null PointerUnion with different active members compare equal
s-barannikov f833dff
Merge branch 'main' into adt/pointer-union-eq
s-barannikov 13a9098
Specialize ValueIsPresent for PointerUnion
s-barannikov 8abd5cd
Update llvm/include/llvm/ADT/PointerUnion.h
s-barannikov 294c617
Merge branch 'main' into adt/pointer-union-eq
s-barannikov 62157bf
Change the specialization for nullable types to cast to bool
s-barannikov 0546ba3
Replace IsNullable with a check that the type can be converted to bool
s-barannikov f0140f8
Add IsNullable check back
s-barannikov 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
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.
I don't think either of these 2 instances should ever encounter a register without a set class or bank, this is papering over a different bug?
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.
Input gMIR to instruction selector shouldn't contain registers without class/bank.
Such registers are created during instruction selection if an imported SelectionDAG pattern contains several instructions in the "destination DAG" of the pattern:
This is what
-gen-global-iselgenerates for this pattern:GIR_MakeTempRegcreates a register without class/bank for the result of theS_MOV_B32. The register gets its class when executingGIR_ConstrainSelectedInstOperandsaction, which calls this function, which callsMRI.setRegClass()at the end.I don't know if this should be considered a bug. If it should, I can try to address it separately (probably in #121270).
(Unrelated to this PR). Note that the type of the temporary register is
s1. It is chosen arbitrarily.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 I mentioned in the other PR this is broken. In no context should an incomplete virtual register be used by an instruction
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.
It appears there is another context when class/bank may not be set: 7e1f66d
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.
After regbankselect / in the selection pass, there must be a class or bank set. The null/null case is only valid before that, when a generic vreg must have a type