[Mlir-commits] [mlir] [MLIR] [AMX] Utilize x86_amx type for AMX dialect in MLIR. (PR #111197)

Ilya Enkovich llvmlistbot at llvm.org
Mon Oct 28 10:42:20 PDT 2024


================
@@ -258,6 +259,9 @@ class LLVMTypeConverter : public TypeConverter {
   /// Convert a 1D vector type into an LLVM vector type.
   FailureOr<Type> convertVectorType(VectorType type) const;
 
+  /// Convert AMX tile type x86_amx type.
+  Type convertAMXTileType(amx::TileType type) const;
----------------
ienkovich wrote:

> I'm not sure what you mean by this. Should be possible to create a new type in the LLVM dialect that lowers directly to the LLVM IR type.

This patch already has such a type in the LLVM dialect. It's `LLVM::LLVMX86AMXType` added to `LLVMTypes.td`. Changes added to the LLVM type converter are required to convert `amx::TileType` to this `LLVMX86AMXType`. These changes allow existing passes (such as CF to LLVM lowering) to properly convert `amx::TileType` values to `LLVM::LLVMX86AMXType` values.

> Is this the only case of custom type conversion into LLVM? Are there no other examples in tree?

I didn't see any similar cases. Users have to use their type converters to handle non-builtin types.

https://github.com/llvm/llvm-project/pull/111197


More information about the Mlir-commits mailing list