#include "mlir/Dialect/ArmSVE/ArmSVEDialect.h"
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
-#include "mlir/Dialect/Vector/VectorOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/OpImplementation.h"
#include "llvm/ADT/TypeSwitch.h"
using namespace mlir;
-using namespace arm_sve;
+using namespace mlir::arm_sve;
-#include "mlir/Dialect/ArmSVE/ArmSVEDialect.cpp.inc"
+//===----------------------------------------------------------------------===//
+// ScalableVector versions of general helpers for comparison ops
+//===----------------------------------------------------------------------===//
+
+/// Return the scalable vector of the same shape and containing i1.
+static Type getI1SameShape(Type type) {
+ auto i1Type = IntegerType::get(type.getContext(), 1);
+ if (auto sVectorType = type.dyn_cast<VectorType>())
+ return VectorType::get(sVectorType.getShape(), i1Type,
+ sVectorType.getNumScalableDims());
+ return nullptr;
+}
+
+//===----------------------------------------------------------------------===//
+// Tablegen Definitions
+//===----------------------------------------------------------------------===//
-static Type getI1SameShape(Type type);
+#include "mlir/Dialect/ArmSVE/ArmSVEDialect.cpp.inc"
#define GET_OP_CLASSES
#include "mlir/Dialect/ArmSVE/ArmSVE.cpp.inc"
#include "mlir/Dialect/ArmSVE/ArmSVE.cpp.inc"
>();
}
-
-//===----------------------------------------------------------------------===//
-// ScalableVector versions of general helpers for comparison ops
-//===----------------------------------------------------------------------===//
-
-// Return the scalable vector of the same shape and containing i1.
-static Type getI1SameShape(Type type) {
- auto i1Type = IntegerType::get(type.getContext(), 1);
- if (auto sVectorType = type.dyn_cast<VectorType>())
- return VectorType::get(sVectorType.getShape(), i1Type,
- sVectorType.getNumScalableDims());
- return nullptr;
-}
#include "mlir/Dialect/ArmSVE/ArmSVEDialect.h"
#include "mlir/Dialect/ArmSVE/Transforms.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
-#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/PatternMatch.h"
}
};
-class ReturnOpTypeConversion : public OpConversionPattern<ReturnOp> {
-public:
- using OpConversionPattern<ReturnOp>::OpConversionPattern;
-
- LogicalResult
- matchAndRewrite(ReturnOp op, OpAdaptor adaptor,
- ConversionPatternRewriter &rewriter) const final {
- rewriter.updateRootInPlace(
- op, [&]() { op->setOperands(adaptor.getOperands()); });
- return success();
- }
-};
-
using SdotOpLowering = OneToOneConvertToLLVMPattern<SdotOp, SdotIntrOp>;
using SmmlaOpLowering = OneToOneConvertToLLVMPattern<SmmlaOp, SmmlaIntrOp>;
using UdotOpLowering = OneToOneConvertToLLVMPattern<UdotOp, UdotIntrOp>;