13#ifndef AIE_DIALECT_AIEVEC_IR_AIEVECMATMUL_H
14#define AIE_DIALECT_AIEVEC_IR_AIEVECMATMUL_H
18#include "mlir/IR/BuiltinTypes.h"
19#include "mlir/IR/Diagnostics.h"
20#include "mlir/IR/PatternMatch.h"
21#include "llvm/ADT/STLFunctionalExtras.h"
22#include "llvm/ADT/SmallVector.h"
67std::optional<MatMulRecipe>
getMatMulRecipe(
bool aie2p, mlir::Type lhsElemTy,
69 mlir::Type accElemTy, int64_t m,
70 int64_t k, int64_t n);
78std::optional<llvm::SmallVector<ShuffleMode, 2>>
89 bool aie2p, mlir::VectorType lhsTy, mlir::VectorType rhsTy,
90 mlir::VectorType accTy,
bool lhsTransposed,
bool rhsTransposed,
91 llvm::function_ref<mlir::InFlightDiagnostic()> emitError =
nullptr);
std::optional< MatMulRecipe > checkMatMulTile(bool aie2p, mlir::VectorType lhsTy, mlir::VectorType rhsTy, mlir::VectorType accTy, bool lhsTransposed, bool rhsTransposed, llvm::function_ref< mlir::InFlightDiagnostic()> emitError=nullptr)
std::optional< llvm::SmallVector< ShuffleMode, 2 > > getTileTransposeModes(bool aie2p, mlir::Type elemTy, int64_t rows, int64_t cols)
bool isBFP16MatMulRhsOnly(ToBFP16Op op)
mlir::LogicalResult expandBFP16MatMul(mlir::RewriterBase &rewriter, MatMulOp_AIE2P op)
bool isBFP16MatMulLhsOnly(ToBFP16Op op)
@ AIE2_I16xI16_2x4x8_Acc64
@ AIE2_I16xI16_4x4x4_Acc64
@ AIE2_I16xI8_2x8x8_Acc64
@ AIE2_I16xI8_4x8x4_Acc64
@ AIE2_I32xI16_4x2x4_Acc64
std::optional< MatMulRecipe > getMatMulRecipe(bool aie2p, mlir::Type lhsElemTy, mlir::Type rhsElemTy, mlir::Type accElemTy, int64_t m, int64_t k, int64_t n)