This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix SameOperandsAndResultType to check encoding.
ClosedPublic

Authored by jpienaar on Dec 20 2022, 5:13 PM.

Details

Summary

Encoding was accidentally left out here even though it forms part of the type.
This is small tightening step and I'll look at follow on to tighten more.

Diff Detail

Event Timeline

jpienaar created this revision.Dec 20 2022, 5:13 PM
jpienaar requested review of this revision.Dec 20 2022, 5:13 PM
Mogball accepted this revision.Dec 20 2022, 6:01 PM

I'm getting confused as to what this trait actually means anymore. Why doesn't it just check that the types are pointer equal?

This revision is now accepted and ready to land.Dec 20 2022, 6:01 PM

I agree with Jeff here, and think this is getting further out of hand. I strongly feel like we should push https://reviews.llvm.org/D125051 forward.

I agree with Jeff here, and think this is getting further out of hand. I strongly feel like we should push https://reviews.llvm.org/D125051 forward.

I'll look at that one after as its more invasive.

I'm getting confused as to what this trait actually means anymore. Why doesn't it just check that the types are pointer equal?

This trait signifies equivalence and only flags where known non-matching (not where potentially not matching). E.g., tensor<?xf32> input to op where the other operands is tensor<2xf32> effectively means post type inference these should be equal or an error, or alternatively that we have effectively a runtime assert that they are equal. Which is also true for 2 tensor<?xf32> operands that pointer equality is not sufficient, it has to match executionally - the same static type doesn't suffice, we require the fully known type to be equal, which is something that the pointer check would be permissive off. But it would not fail verification with tensor<?xf32> != tensor<2xf32> . So it means one can express this type constraint and represents something different than the raw type being the same. Naming is difficult.

(and by that mean I agree it is confusing and I'm perfectly open to renaming)

This revision was automatically updated to reflect the committed changes.