-
Notifications
You must be signed in to change notification settings - Fork 82
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
cir.vec.create
syntax is a bit confusing
#541
Comments
Those are valid criticisms of the
which was the simplest way I could find to get it to work. I like the suggestion of |
Now I remember what the complication was. All of the element values must be of the same type. But I couldn't find an example of another operation like that. I know how to add a constraint to the operation definition that requires the type of an input to match the element type of a vector. But I don't know how to specify that all the items in a variadic list of inputs need to match the element type of a vector. Is there an MLIR operation that has similar constraints that I can use as an example? If not, do you have any pointers about how to go about this? |
@dkolsen-pgi thanks for looking at this. By the way, I think you did a great job introducing this, I couldn't notice the output during code review and the approach is totally fine, just a note that we can probably make it a bit better (feel free to leave this a "good-first-issue" to a newcomer if you prefer). I learned about this while looking at inline asm in #512
The most similar ones seems to be
I started introducing a few CIR specific ones, see |
Take this example:
This is building a vector with two elements
[%1, %1]
, right? Assuming I'm right, this is a bit confusing to read for two reasons:%1
has the typeIt's possible we add constraints as to only print
%2 = cir.vec.create(%1, %1) : !cir.vector<!s32i x 2>
, since!cir.vector
's elt type has all the info for logic to figure out. Alternatively, we could only add the type for the first operand, since all the others have to be the same:%2 = cir.vec.create(%1 : !s32i, %1) : !cir.vector<!s32i x 2>
.Thoughts?
cc: @gitoleg @dkolsen-pgi
The text was updated successfully, but these errors were encountered: