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.
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
[RISCV][GISel] Add ISel supports for SHXADD from Zba extension #67863
[RISCV][GISel] Add ISel supports for SHXADD from Zba extension #67863
Changes from 2 commits
08f77d6
4d81ad5
2d4dce1
9de0c2f
0b2e658
5484c7e
9eef0c5
d8edaba
7df267f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 merge this condition with the previous if?
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.
Was this comment addressed?
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 is addressed now
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 you add
let GISelPredicateCode
here to do this without changing to a complex pattern?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 some digging, I think the answer is no and I'm sad about it.
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.
Correct, using
GISelPredicateCode
was my first approach until I found that theGlobalISelEmitter
TG backend doesn't pick that up for leaf nodes.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.
Would add GISelPredicateCode to something like this work topperc@01205c1
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.
This works, though I'm a little concerned that this might create too many boilerplate code in the future, since there needs to be a Predicate TG record for every opcode that goes with non_imm12 (even we abstract the real predicate logics into a function). What do you think?
Also, interestingly
GISelPredicateCode
doesn't dance well withPredicateCodeUsesOperands
: it SEGFAULT llvm-tblgen in our case, despite the fact that there are tests for this exact combination (intest/TableGen/GlobalISelEmitterCustomPredicate.td
). I can't find an obvious fix for llvm-tblgen but writing a non-PredicateCodeUsesOperands
predicate code works so I'm not too bothered by this crash (for now).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 used
PredicateCodeUsesOperands
so that I could know which operand wasn't theshl
since add is commutable and tblgen will generate both patterns.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.
Done: it's no longer using ComplexPattern of
non_imm12
but PatFrag of<op>_with_non_imm12
instead