I’m trying to define some tensor constants with std.constant but notice mlir-opt just crashes with some very simple cases. I have my test cases listed below for reference. Is constant tensor a supported scenario for std.constant? I probably missed something obvious. Thanks.
The std to llvm pass isn’t meant to handle tensor types - these types are too high level an abstraction for it. But a crash is always a bug! It should’ve been a lowering failure. Please use either memory or scalar types when going into the LLVM dialect. One could build a type conversion pass that converts such ops on tensor types to either memref’s or scalar types (in the case of 0-d tensors) on the std dialect, but such a thing doesn’t exist. Often these conversions are performed right on the higher level dialects that actually use those tensor types extensively in conjunction with other compute ops (as opposed to just those that generate constants).