Memref of aliased types

I am able to use the type memref<1x1x1x1xquant.uniform<u8<1:255>:f16, 6.17568E-5:128>> without any problems.

But when I try using type aliases like this:

!qtype = type !quant.uniform<u8<1:255>:f16, 6.17568E-5:128>

memref<1x1x1x1x!qtype>

I get an “invalid memref element type”. Does anyone know how to properly use type aliases in this scenario?

This is strange, it is not an allowed element type in memrefs - llvm-project/BuiltinTypes.h at f8d3f47e1fd09392aa30df83849b25acd8c59a25 · llvm/llvm-project · GitHub. Which version of MLIR are you using?

I think the version that I’m using is from about 2 weeks ago: 5eec9a380a24

It’s the same check - llvm-project/BuiltinTypes.h at 5eec9a380a24bf0611c676b5da4933949c787a6b · llvm/llvm-project · GitHub - types other than integers, floats, complex and vectors of integers or floats are not allowed as memref elements. At the commit in question, I get

$ cat foo.mlir 
func private @foo() -> memref<1x1x1x1x!quant.uniform<u8<1:255>:f16, 6.17568E-5:128>>

$ ./bin/mlir-opt foo.mlir 
foo.mlir:1:39: error: invalid memref element type
func private @foo() -> memref<1x1x1x1x!quant.uniform<u8<1:255>:f16, 6.17568E-5:128>>
                                      ^

so it’s not an alias problem. If you can use such types, you seem to either have a patched version of MLIR that diverges from upstream or not running verification.