[mlir:ArmSVE][NFC] Remove dead code and unnecessary dependencies
authorRiver Riddle <riddleriver@gmail.com>
Fri, 21 Jan 2022 20:35:08 +0000 (12:35 -0800)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 25 Jan 2022 03:25:53 +0000 (19:25 -0800)
Differential Revision: https://reviews.llvm.org/D117981

mlir/include/mlir/Dialect/ArmSVE/ArmSVE.td
mlir/lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp
mlir/lib/Dialect/ArmSVE/IR/CMakeLists.txt
mlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp

index 5ffcf74..19dcfab 100644 (file)
@@ -15,7 +15,6 @@
 
 include "mlir/Interfaces/SideEffectInterfaces.td"
 include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
-include "mlir/Dialect/Arithmetic/IR/ArithmeticBase.td"
 
 //===----------------------------------------------------------------------===//
 // ArmSVE dialect definition
index b3c7904..1ea2fad 100644 (file)
@@ -12,7 +12,6 @@
 
 #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"
@@ -38,16 +52,3 @@ void ArmSVEDialect::initialize() {
 #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;
-}
index 4a2393e..9177b58 100644 (file)
@@ -10,6 +10,5 @@ add_mlir_dialect_library(MLIRArmSVE
   LINK_LIBS PUBLIC
   MLIRIR
   MLIRLLVMIR
-  MLIRStandard
   MLIRSideEffectInterfaces
   )
index fdda398..95bc3e6 100644 (file)
@@ -11,7 +11,6 @@
 #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"
 
@@ -34,19 +33,6 @@ class ForwardOperands : public OpConversionPattern<OpTy> {
   }
 };
 
-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>;