[Mlir-commits] [mlir] 0c23163 - Revert "[mlir] Add `res()` method to `linalg::ContractionOpInterface` (#76539)"

Mitch Phillips llvmlistbot at llvm.org
Thu Jan 4 01:37:59 PST 2024


Author: Mitch Phillips
Date: 2024-01-04T10:37:32+01:00
New Revision: 0c23163184e098e1aac128cbbd7b4c2b4bd6bb26

URL: https://github.com/llvm/llvm-project/commit/0c23163184e098e1aac128cbbd7b4c2b4bd6bb26
DIFF: https://github.com/llvm/llvm-project/commit/0c23163184e098e1aac128cbbd7b4c2b4bd6bb26.diff

LOG: Revert "[mlir] Add `res()` method to `linalg::ContractionOpInterface` (#76539)"

This reverts commit 53edf12e526704cc251b6a6917319c7cb7a653a0.

Reason: Broke the sanitizer buildbots with a memory leak. More
information available on
https://github.com/llvm/llvm-project/commit/53edf12e526704cc251b6a6917319c7cb7a653a0

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
    mlir/unittests/Dialect/CMakeLists.txt

Removed: 
    mlir/unittests/Dialect/Linalg/CMakeLists.txt
    mlir/unittests/Dialect/Linalg/LinalgInterfacesTest.cpp


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
index 777d7cfd558d2a..fbf3f19cde0e9b 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
@@ -54,14 +54,6 @@ def LinalgContractionOpInterface : OpInterface<"ContractionOpInterface"> {
       return $_op.getOperation()->getOperand(1);
     }]>,
     InterfaceMethod<
-    /*desc=*/"Returns the result value.",
-    /*retTy=*/"OpResult",
-    /*methodName=*/"res",
-    /*args=*/(ins),
-    /*methodBody=*/[{
-      return $_op.getOperation()->getResult(0);
-    }]>,
-    InterfaceMethod<
     /*desc=*/[{
       Returns whether the given op has indexing maps that correspond to a
       row-major matmul operation.

diff  --git a/mlir/unittests/Dialect/CMakeLists.txt b/mlir/unittests/Dialect/CMakeLists.txt
index 76b698d1d1a7b1..2dec4ba3c001e8 100644
--- a/mlir/unittests/Dialect/CMakeLists.txt
+++ b/mlir/unittests/Dialect/CMakeLists.txt
@@ -8,7 +8,6 @@ target_link_libraries(MLIRDialectTests
 
 add_subdirectory(ArmSME)
 add_subdirectory(Index)
-add_subdirectory(Linalg)
 add_subdirectory(LLVMIR)
 add_subdirectory(MemRef)
 add_subdirectory(SCF)

diff  --git a/mlir/unittests/Dialect/Linalg/CMakeLists.txt b/mlir/unittests/Dialect/Linalg/CMakeLists.txt
deleted file mode 100644
index 080caab8d075ec..00000000000000
--- a/mlir/unittests/Dialect/Linalg/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-add_mlir_unittest(MLIRLinalgTests
-  LinalgInterfacesTest.cpp
-)
-target_link_libraries(MLIRLinalgTests
-  PRIVATE
-  MLIRLinalgDialect
-  )
-

diff  --git a/mlir/unittests/Dialect/Linalg/LinalgInterfacesTest.cpp b/mlir/unittests/Dialect/Linalg/LinalgInterfacesTest.cpp
deleted file mode 100644
index 8cc4a5e37c4529..00000000000000
--- a/mlir/unittests/Dialect/Linalg/LinalgInterfacesTest.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//===- LinalgInterfacesTest.cpp - LinalgInterfaces unit tests ----------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Dialect/Linalg/IR/Linalg.h"
-#include "mlir/Dialect/Tensor/IR/Tensor.h"
-
-#include "gtest/gtest.h"
-
-using namespace mlir;
-
-class LinalgInterfacesTest : public ::testing::Test {
-protected:
-  LinalgInterfacesTest() {
-    context.getOrLoadDialect<mlir::linalg::LinalgDialect>();
-  }
-
-  mlir::MLIRContext context;
-};
-
-TEST_F(LinalgInterfacesTest, ContractionOpOperandResultAccessor) {
-  OpBuilder b(&context);
-  SmallVector<int64_t> lhsShape = {1, 2};
-  SmallVector<int64_t> rhsShape = {2, 4};
-  SmallVector<int64_t> resShape = {1, 4};
-  auto lhs = b.create<tensor::EmptyOp>(UnknownLoc::get(&context), lhsShape,
-                                       b.getF32Type());
-  auto rhs = b.create<tensor::EmptyOp>(UnknownLoc::get(&context), rhsShape,
-                                       b.getF32Type());
-  auto out = b.create<tensor::EmptyOp>(UnknownLoc::get(&context), resShape,
-                                       b.getF32Type());
-  Operation *op = b.create<linalg::MatmulOp>(
-      UnknownLoc::get(&context), ValueRange{lhs, rhs}, ValueRange{out});
-  auto contractOp = llvm::cast<linalg::ContractionOpInterface>(op);
-
-  EXPECT_EQ(contractOp.lhs(), op->getOperand(0));
-  EXPECT_EQ(contractOp.rhs(), op->getOperand(1));
-  EXPECT_EQ(contractOp.res(), op->getResult(0));
-}


        


More information about the Mlir-commits mailing list