chore: risc-v dialects now prefer size-64 bitvectors instead of arbitrary integers - #1466
Merged
Merged
Conversation
regehr
marked this pull request as ready for review
September 14, 2026 14:56
tobiasgrosser
approved these changes
Sep 14, 2026
tobiasgrosser
left a comment
Collaborator
There was a problem hiding this comment.
I had initially thought to just add verifier to check that the type is an i64. This is a bit more involved, but seems to make the API a bit simpler. For BitVec constants, there is a nice syntax.
I am happy with this. Let's see what @math-fehr says.
naveen-seth
approved these changes
Sep 14, 2026
naveen-seth
left a comment
Contributor
There was a problem hiding this comment.
I found nothing else; LGTM!
math-fehr
approved these changes
Sep 14, 2026
math-fehr
left a comment
Collaborator
There was a problem hiding this comment.
Tobias pointed most of the issues already, besides that this is good to me!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
in upstream dialects like Arith and LLVM, we're forced to deal with literal constants whose attribute width differs from the width of the operation, making things potentially confusing and error-prone.
in our own RISC-V dialects, we're not constrained by upstream, so this PR is a simplification removing that degree of freedom and furthermore just centralizing on
i64as the internal data representation for our RISC-V dialects. this removes some possibilities for errors around signed/unsigned conversions and I think it's a good change overall.