The number of operands may not have been verified here yet, lets return failure if there are not 2 operands
Lets check here that it is one of the given types just as haven't verified (lets chat about that later this week too)
Seems like a few of these could be deduped, which would help if we have shared functions here to refactor later.
We don't have a formatgter for this yet, but the convention we've been following is to have : ShapeOp on the line in line with the def
def Shape_AddOp : Shape_Op<"add", [
in some cases the [ and traits on the next, but mostly it opens on the former.
May be a case of missing change upload again , I'll double check
Mmm, this seems to be the same as
return l.front().isa<SizeType, IndexType>() || r.front().isa<SizeType, IndexType>() ?
Aren't these the only two allowed types for this operand?
Perhaps (here and below), Returns when two result types are compatible for this op; method used by InferTypeOpInterface ?
Could we make a static helper function and just call it from the others? (this seems like the same code below)
If we had
lhs.isa<IndexType, SizeType> && rhs.isa<SizeType, IndexType>()
but lhs.isa<IndexType> && rhs.isa<SizeType>, then this would fail, but seems fine/non-error. Or am I missing it?
Could we just use operands.getType() here rather than getting one?