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

Ilya Enkovich llvmlistbot at llvm.org
Mon Oct 7 12:30:47 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 don't see how I can go directly from `amx::TileType` to `llvm::x86_type`. For proper conversion of MLIR module to LLVM module, all types should be LLVM compatible and this is defined by LLVMIR dialect. I cannot declare an external LLVM compatible type.

The only simple way to get rid of the new dependency here is to move `amx::TileType` to bulitin types. It would better match what we have in LLVM, but doesn't feel good.

Probably, the best solution would be to introduce a type interface for converting custom types to LLVMIR dialect types. Then we can utilize this interface in `LLVMTypeConverter` and keep `amx::TileType` to `LLVMX86AMXType` conversion code in AMX dialect removing dependency of LLVM converter on AMX dialect.

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


More information about the Mlir-commits mailing list