[Mlir-commits] [mlir] e66f2be - [mlir][IR][NFC] Move CastOpInterface helpers to mlir/Interfaces

Matthias Springer llvmlistbot at llvm.org
Thu Jun 1 23:39:56 PDT 2023


Author: Matthias Springer
Date: 2023-06-02T08:39:46+02:00
New Revision: e66f2beba8b38b148d3a892326a7133c388ffbfb

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

LOG: [mlir][IR][NFC] Move CastOpInterface helpers to mlir/Interfaces

These helpers should not be part of the IR build unit.

The interface is now implemented on `builtin.unrealized_conversion_cast` with an external model.

Also rename the CastOpInterfaces Bazel target name to CastInterfaces to be consistent with the CMake target name.

Differential Revision: https://reviews.llvm.org/D146972

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/EmitC/IR/EmitC.h
    mlir/include/mlir/Dialect/Shape/IR/Shape.h
    mlir/include/mlir/IR/BuiltinOps.h
    mlir/include/mlir/IR/BuiltinOps.td
    mlir/include/mlir/IR/OpDefinition.h
    mlir/include/mlir/InitAllDialects.h
    mlir/include/mlir/Interfaces/CastInterfaces.h
    mlir/include/mlir/Interfaces/CastInterfaces.td
    mlir/lib/Dialect/Arith/IR/CMakeLists.txt
    mlir/lib/Dialect/Transform/IR/CMakeLists.txt
    mlir/lib/IR/BuiltinDialect.cpp
    mlir/lib/IR/Operation.cpp
    mlir/lib/Interfaces/CastInterfaces.cpp
    mlir/test/lib/Tools/PDLL/CMakeLists.txt
    mlir/test/lib/Tools/PDLL/TestPDLL.cpp
    mlir/tools/mlir-opt/CMakeLists.txt
    utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
    utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
    utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
    utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
    utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
    utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.h b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.h
index cd8b9748e14e7..0acaa85139508 100644
--- a/mlir/include/mlir/Dialect/EmitC/IR/EmitC.h
+++ b/mlir/include/mlir/Dialect/EmitC/IR/EmitC.h
@@ -17,6 +17,7 @@
 #include "mlir/IR/BuiltinOps.h"
 #include "mlir/IR/BuiltinTypes.h"
 #include "mlir/IR/Dialect.h"
+#include "mlir/Interfaces/CastInterfaces.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
 
 #include "mlir/Dialect/EmitC/IR/EmitCDialect.h.inc"

diff  --git a/mlir/include/mlir/Dialect/Shape/IR/Shape.h b/mlir/include/mlir/Dialect/Shape/IR/Shape.h
index 6efa57819b491..f6a5a984644d1 100644
--- a/mlir/include/mlir/Dialect/Shape/IR/Shape.h
+++ b/mlir/include/mlir/Dialect/Shape/IR/Shape.h
@@ -22,6 +22,7 @@
 #include "mlir/IR/OpImplementation.h"
 #include "mlir/IR/SymbolTable.h"
 #include "mlir/Interfaces/CallInterfaces.h"
+#include "mlir/Interfaces/CastInterfaces.h"
 #include "mlir/Interfaces/ControlFlowInterfaces.h"
 #include "mlir/Interfaces/InferTypeOpInterface.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"

diff  --git a/mlir/include/mlir/IR/BuiltinOps.h b/mlir/include/mlir/IR/BuiltinOps.h
index f01237dde3fd0..8abe4cae0d80f 100644
--- a/mlir/include/mlir/IR/BuiltinOps.h
+++ b/mlir/include/mlir/IR/BuiltinOps.h
@@ -17,7 +17,6 @@
 #include "mlir/IR/OwningOpRef.h"
 #include "mlir/IR/RegionKindInterface.h"
 #include "mlir/IR/SymbolTable.h"
-#include "mlir/Interfaces/CastInterfaces.h"
 #include "mlir/Interfaces/DataLayoutInterfaces.h"
 #include "mlir/Interfaces/SideEffectInterfaces.h"
 #include "llvm/Support/PointerLikeTypeTraits.h"

diff  --git a/mlir/include/mlir/IR/BuiltinOps.td b/mlir/include/mlir/IR/BuiltinOps.td
index da4ba43c08a5e..eda24615c71ea 100644
--- a/mlir/include/mlir/IR/BuiltinOps.td
+++ b/mlir/include/mlir/IR/BuiltinOps.td
@@ -99,7 +99,7 @@ def ModuleOp : Builtin_Op<"module", [
 //===----------------------------------------------------------------------===//
 
 def UnrealizedConversionCastOp : Builtin_Op<"unrealized_conversion_cast", [
-    DeclareOpInterfaceMethods<CastOpInterface>, Pure
+    Pure
   ]> {
   let summary = "An unrealized conversion from one set of types to another";
   let description = [{
@@ -141,6 +141,7 @@ def UnrealizedConversionCastOp : Builtin_Op<"unrealized_conversion_cast", [
     ($inputs^ `:` type($inputs))? `to` type($outputs) attr-dict
   }];
   let hasFolder = 1;
+  let hasVerifier = 1;
 }
 
 #endif // BUILTIN_OPS

diff  --git a/mlir/include/mlir/IR/OpDefinition.h b/mlir/include/mlir/IR/OpDefinition.h
index f3734dc648275..2cdfbf031ec6e 100644
--- a/mlir/include/mlir/IR/OpDefinition.h
+++ b/mlir/include/mlir/IR/OpDefinition.h
@@ -2104,21 +2104,6 @@ class OpInterface
   friend InterfaceBase;
 };
 
-//===----------------------------------------------------------------------===//
-// CastOpInterface utilities
-//===----------------------------------------------------------------------===//
-
-// These functions are out-of-line implementations of the methods in
-// CastOpInterface, which avoids them being template instantiated/duplicated.
-namespace impl {
-/// Attempt to fold the given cast operation.
-LogicalResult foldCastInterfaceOp(Operation *op,
-                                  ArrayRef<Attribute> attrOperands,
-                                  SmallVectorImpl<OpFoldResult> &foldResults);
-/// Attempt to verify the given cast operation.
-LogicalResult verifyCastInterfaceOp(
-    Operation *op, function_ref<bool(TypeRange, TypeRange)> areCastCompatible);
-} // namespace impl
 } // namespace mlir
 
 namespace llvm {

diff  --git a/mlir/include/mlir/InitAllDialects.h b/mlir/include/mlir/InitAllDialects.h
index e307b236b39a5..722c207904d90 100644
--- a/mlir/include/mlir/InitAllDialects.h
+++ b/mlir/include/mlir/InitAllDialects.h
@@ -82,6 +82,7 @@
 #include "mlir/Dialect/Vector/Transforms/BufferizableOpInterfaceImpl.h"
 #include "mlir/Dialect/X86Vector/X86VectorDialect.h"
 #include "mlir/IR/Dialect.h"
+#include "mlir/Interfaces/CastInterfaces.h"
 
 namespace mlir {
 
@@ -145,6 +146,7 @@ inline void registerAllDialects(DialectRegistry &registry) {
   arith::registerValueBoundsOpInterfaceExternalModels(registry);
   bufferization::func_ext::registerBufferizableOpInterfaceExternalModels(
       registry);
+  builtin::registerCastOpInterfaceExternalModels(registry);
   linalg::registerBufferizableOpInterfaceExternalModels(registry);
   linalg::registerTilingInterfaceExternalModels(registry);
   linalg::registerValueBoundsOpInterfaceExternalModels(registry);

diff  --git a/mlir/include/mlir/Interfaces/CastInterfaces.h b/mlir/include/mlir/Interfaces/CastInterfaces.h
index 99a1f2ed7821d..991b084b8b44d 100644
--- a/mlir/include/mlir/Interfaces/CastInterfaces.h
+++ b/mlir/include/mlir/Interfaces/CastInterfaces.h
@@ -16,6 +16,24 @@
 
 #include "mlir/IR/OpDefinition.h"
 
+namespace mlir {
+class DialectRegistry;
+
+namespace impl {
+/// Attempt to fold the given cast operation.
+LogicalResult foldCastInterfaceOp(Operation *op,
+                                  ArrayRef<Attribute> attrOperands,
+                                  SmallVectorImpl<OpFoldResult> &foldResults);
+
+/// Attempt to verify the given cast operation.
+LogicalResult verifyCastInterfaceOp(Operation *op);
+} // namespace impl
+
+namespace builtin {
+void registerCastOpInterfaceExternalModels(DialectRegistry &registry);
+} // namespace builtin
+} // namespace mlir
+
 /// Include the generated interface declarations.
 #include "mlir/Interfaces/CastInterfaces.h.inc"
 

diff  --git a/mlir/include/mlir/Interfaces/CastInterfaces.td b/mlir/include/mlir/Interfaces/CastInterfaces.td
index cff239773d0dd..3b81eef8b864b 100644
--- a/mlir/include/mlir/Interfaces/CastInterfaces.td
+++ b/mlir/include/mlir/Interfaces/CastInterfaces.td
@@ -44,7 +44,7 @@ def CastOpInterface : OpInterface<"CastOpInterface"> {
     }
   }];
   let verify = [{
-    return impl::verifyCastInterfaceOp($_op, ConcreteOp::areCastCompatible);
+    return impl::verifyCastInterfaceOp($_op);
   }];
 }
 

diff  --git a/mlir/lib/Dialect/Arith/IR/CMakeLists.txt b/mlir/lib/Dialect/Arith/IR/CMakeLists.txt
index eb1acecc2d103..fdbeb39e60c06 100644
--- a/mlir/lib/Dialect/Arith/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Arith/IR/CMakeLists.txt
@@ -22,6 +22,7 @@ add_mlir_dialect_library(MLIRArithDialect
   MLIRArithOpsInterfacesIncGen
 
   LINK_LIBS PUBLIC
+  MLIRCastInterfaces
   MLIRDialect
   MLIRInferIntRangeCommon
   MLIRInferIntRangeInterface

diff  --git a/mlir/lib/Dialect/Transform/IR/CMakeLists.txt b/mlir/lib/Dialect/Transform/IR/CMakeLists.txt
index 4fb27512c4907..62a1f3da1d8fd 100644
--- a/mlir/lib/Dialect/Transform/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Transform/IR/CMakeLists.txt
@@ -12,6 +12,7 @@ add_mlir_dialect_library(MLIRTransformDialect
   MLIRTransformInterfacesIncGen
 
   LINK_LIBS PUBLIC
+  MLIRCastInterfaces
   MLIRIR
   MLIRParser
   MLIRRewrite

diff  --git a/mlir/lib/IR/BuiltinDialect.cpp b/mlir/lib/IR/BuiltinDialect.cpp
index f73863248969d..a791b97c12a69 100644
--- a/mlir/lib/IR/BuiltinDialect.cpp
+++ b/mlir/lib/IR/BuiltinDialect.cpp
@@ -217,10 +217,12 @@ UnrealizedConversionCastOp::fold(FoldAdaptor adaptor,
   return success();
 }
 
-bool UnrealizedConversionCastOp::areCastCompatible(TypeRange inputs,
-                                                   TypeRange outputs) {
-  // `UnrealizedConversionCastOp` is agnostic of the input/output types.
-  return true;
+LogicalResult UnrealizedConversionCastOp::verify() {
+  // TODO: The verifier of external models is not called. This op verifier can
+  // be removed when that is fixed.
+  if (getNumResults() == 0)
+    return emitOpError() << "expected at least one result for cast operation";
+  return success();
 }
 
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp
index eaf5a471a99ab..449c97d469bf6 100644
--- a/mlir/lib/IR/Operation.cpp
+++ b/mlir/lib/IR/Operation.cpp
@@ -1275,52 +1275,6 @@ bool OpTrait::hasElementwiseMappableTraits(Operation *op) {
          op->hasTrait<Vectorizable>() && op->hasTrait<Tensorizable>();
 }
 
-//===----------------------------------------------------------------------===//
-// CastOpInterface
-//===----------------------------------------------------------------------===//
-
-/// Attempt to fold the given cast operation.
-LogicalResult
-impl::foldCastInterfaceOp(Operation *op, ArrayRef<Attribute> attrOperands,
-                          SmallVectorImpl<OpFoldResult> &foldResults) {
-  OperandRange operands = op->getOperands();
-  if (operands.empty())
-    return failure();
-  ResultRange results = op->getResults();
-
-  // Check for the case where the input and output types match 1-1.
-  if (operands.getTypes() == results.getTypes()) {
-    foldResults.append(operands.begin(), operands.end());
-    return success();
-  }
-
-  return failure();
-}
-
-/// Attempt to verify the given cast operation.
-LogicalResult impl::verifyCastInterfaceOp(
-    Operation *op, function_ref<bool(TypeRange, TypeRange)> areCastCompatible) {
-  auto resultTypes = op->getResultTypes();
-  if (resultTypes.empty())
-    return op->emitOpError()
-           << "expected at least one result for cast operation";
-
-  auto operandTypes = op->getOperandTypes();
-  if (!areCastCompatible(operandTypes, resultTypes)) {
-    InFlightDiagnostic diag = op->emitOpError("operand type");
-    if (operandTypes.empty())
-      diag << "s []";
-    else if (llvm::size(operandTypes) == 1)
-      diag << " " << *operandTypes.begin();
-    else
-      diag << "s " << operandTypes;
-    return diag << " and result type" << (resultTypes.size() == 1 ? " " : "s ")
-                << resultTypes << " are cast incompatible";
-  }
-
-  return success();
-}
-
 //===----------------------------------------------------------------------===//
 // Misc. utils
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/lib/Interfaces/CastInterfaces.cpp b/mlir/lib/Interfaces/CastInterfaces.cpp
index 400c1978cdaae..05c872daf5dab 100644
--- a/mlir/lib/Interfaces/CastInterfaces.cpp
+++ b/mlir/lib/Interfaces/CastInterfaces.cpp
@@ -8,8 +8,83 @@
 
 #include "mlir/Interfaces/CastInterfaces.h"
 
+#include "mlir/IR/BuiltinDialect.h"
+#include "mlir/IR/BuiltinOps.h"
+
 using namespace mlir;
 
+//===----------------------------------------------------------------------===//
+// Helper functions for CastOpInterface
+//===----------------------------------------------------------------------===//
+
+/// Attempt to fold the given cast operation.
+LogicalResult
+impl::foldCastInterfaceOp(Operation *op, ArrayRef<Attribute> attrOperands,
+                          SmallVectorImpl<OpFoldResult> &foldResults) {
+  OperandRange operands = op->getOperands();
+  if (operands.empty())
+    return failure();
+  ResultRange results = op->getResults();
+
+  // Check for the case where the input and output types match 1-1.
+  if (operands.getTypes() == results.getTypes()) {
+    foldResults.append(operands.begin(), operands.end());
+    return success();
+  }
+
+  return failure();
+}
+
+/// Attempt to verify the given cast operation.
+LogicalResult impl::verifyCastInterfaceOp(Operation *op) {
+  auto resultTypes = op->getResultTypes();
+  if (resultTypes.empty())
+    return op->emitOpError()
+           << "expected at least one result for cast operation";
+
+  auto operandTypes = op->getOperandTypes();
+  if (!cast<CastOpInterface>(op).areCastCompatible(operandTypes, resultTypes)) {
+    InFlightDiagnostic diag = op->emitOpError("operand type");
+    if (operandTypes.empty())
+      diag << "s []";
+    else if (llvm::size(operandTypes) == 1)
+      diag << " " << *operandTypes.begin();
+    else
+      diag << "s " << operandTypes;
+    return diag << " and result type" << (resultTypes.size() == 1 ? " " : "s ")
+                << resultTypes << " are cast incompatible";
+  }
+
+  return success();
+}
+
+//===----------------------------------------------------------------------===//
+// External model for BuiltinDialect ops
+//===----------------------------------------------------------------------===//
+
+namespace mlir {
+namespace {
+// This interface cannot be implemented directly on the op because the IR build
+// unit cannot depend on the Interfaces build unit.
+struct UnrealizedConversionCastOpInterface
+    : CastOpInterface::ExternalModel<UnrealizedConversionCastOpInterface,
+                                     UnrealizedConversionCastOp> {
+  static bool areCastCompatible(TypeRange inputs, TypeRange outputs) {
+    // `UnrealizedConversionCastOp` is agnostic of the input/output types.
+    return true;
+  }
+};
+} // namespace
+} // namespace mlir
+
+void mlir::builtin::registerCastOpInterfaceExternalModels(
+    DialectRegistry &registry) {
+  registry.addExtension(+[](MLIRContext *ctx, BuiltinDialect *dialect) {
+    UnrealizedConversionCastOp::attachInterface<
+        UnrealizedConversionCastOpInterface>(*ctx);
+  });
+}
+
 //===----------------------------------------------------------------------===//
 // Table-generated class definitions
 //===----------------------------------------------------------------------===//

diff  --git a/mlir/test/lib/Tools/PDLL/CMakeLists.txt b/mlir/test/lib/Tools/PDLL/CMakeLists.txt
index 97a897b45dbf9..5ad13062e2a6c 100644
--- a/mlir/test/lib/Tools/PDLL/CMakeLists.txt
+++ b/mlir/test/lib/Tools/PDLL/CMakeLists.txt
@@ -20,6 +20,7 @@ add_mlir_library(MLIRTestPDLL
   MLIRTestPDLLPatternsIncGen
 
   LINK_LIBS PUBLIC
+  MLIRCastInterfaces
   MLIRIR
   MLIRPass
   MLIRSupport

diff  --git a/mlir/test/lib/Tools/PDLL/TestPDLL.cpp b/mlir/test/lib/Tools/PDLL/TestPDLL.cpp
index a8103d4e95255..eb607b9f8941a 100644
--- a/mlir/test/lib/Tools/PDLL/TestPDLL.cpp
+++ b/mlir/test/lib/Tools/PDLL/TestPDLL.cpp
@@ -8,6 +8,7 @@
 
 #include "mlir/Dialect/PDL/IR/PDL.h"
 #include "mlir/Dialect/PDLInterp/IR/PDLInterp.h"
+#include "mlir/Interfaces/CastInterfaces.h"
 #include "mlir/Parser/Parser.h"
 #include "mlir/Pass/Pass.h"
 #include "mlir/Pass/PassManager.h"

diff  --git a/mlir/tools/mlir-opt/CMakeLists.txt b/mlir/tools/mlir-opt/CMakeLists.txt
index 2d021d58c49af..81eb9b0fbda5a 100644
--- a/mlir/tools/mlir-opt/CMakeLists.txt
+++ b/mlir/tools/mlir-opt/CMakeLists.txt
@@ -53,6 +53,7 @@ set(LIBS
   ${test_libs}
   MLIRAffineAnalysis
   MLIRAnalysis
+  MLIRCastInterfaces
   MLIRDialect
   MLIROptLib
   MLIRParser

diff  --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index 3451adc079566..eb59546e0dc35 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -304,7 +304,6 @@ cc_library(
     ]) + [
         "include/mlir/Bytecode/BytecodeImplementation.h",
         "include/mlir/Interfaces/CallInterfaces.h",
-        "include/mlir/Interfaces/CastInterfaces.h",
         "include/mlir/Interfaces/DataLayoutInterfaces.h",
         "include/mlir/Interfaces/FoldInterfaces.h",
         "include/mlir/Interfaces/SideEffectInterfaces.h",
@@ -320,7 +319,6 @@ cc_library(
         ":BuiltinTypeInterfacesIncGen",
         ":BuiltinTypesIncGen",
         ":CallOpInterfacesIncGen",
-        ":CastOpInterfacesIncGen",
         ":DataLayoutInterfacesIncGen",
         ":FunctionInterfacesIncGen",
         ":InferTypeOpInterfaceIncGen",
@@ -2865,6 +2863,7 @@ cc_library(
     includes = ["include"],
     deps = [
         ":BytecodeOpInterface",
+        ":CastInterfaces",
         ":EmitCAttributesIncGen",
         ":EmitCOpsIncGen",
         ":IR",
@@ -3454,6 +3453,7 @@ cc_library(
     deps = [
         ":ArithDialect",
         ":BytecodeOpInterface",
+        ":CastInterfaces",
         ":ControlFlowInterfaces",
         ":Dialect",
         ":FuncDialect",
@@ -3647,7 +3647,7 @@ cc_library(
         ":ArithDialect",
         ":BytecodeOpInterface",
         ":CallOpInterfaces",
-        ":CastOpInterfaces",
+        ":CastInterfaces",
         ":CommonFolders",
         ":ControlFlowDialect",
         ":ControlFlowInterfaces",
@@ -5867,7 +5867,7 @@ cc_library(
         ":ArithDialect",
         ":ArithUtils",
         ":BytecodeOpInterface",
-        ":CastOpInterfaces",
+        ":CastInterfaces",
         ":ComplexDialect",
         ":ControlFlowInterfaces",
         ":DestinationStyleOpInterface",
@@ -6874,7 +6874,7 @@ cc_library(
 )
 
 gentbl_cc_library(
-    name = "CastOpInterfacesIncGen",
+    name = "CastInterfacesIncGen",
     strip_include_prefix = "include",
     tbl_outs = [
         (
@@ -6892,12 +6892,12 @@ gentbl_cc_library(
 )
 
 cc_library(
-    name = "CastOpInterfaces",
+    name = "CastInterfaces",
     srcs = ["lib/Interfaces/CastInterfaces.cpp"],
     hdrs = ["include/mlir/Interfaces/CastInterfaces.h"],
     includes = ["include"],
     deps = [
-        ":CastOpInterfacesIncGen",
+        ":CastInterfacesIncGen",
         ":IR",
         "//llvm:Support",
     ],
@@ -7538,6 +7538,7 @@ cc_library(
         ":BufferizationDialect",
         ":BufferizationTransformOps",
         ":BufferizationTransforms",
+        ":CastInterfaces",
         ":ComplexDialect",
         ":ComplexToLLVM",
         ":ComplexToLibm",
@@ -8698,6 +8699,7 @@ cc_library(
     includes = ["include"],
     deps = [
         ":BytecodeOpInterface",
+        ":CastInterfaces",
         ":IR",
         ":IndexEnumsIncGen",
         ":IndexOpsIncGen",
@@ -10024,6 +10026,7 @@ cc_library(
         ":Analysis",
         ":BytecodeOpInterface",
         ":CallOpInterfaces",
+        ":CastInterfaces",
         ":ControlFlowInterfaces",
         ":IR",
         ":Rewrite",
@@ -10501,6 +10504,7 @@ cc_library(
         ":ArithOpsIncGen",
         ":ArithOpsInterfacesIncGen",
         ":BytecodeOpInterface",
+        ":CastInterfaces",
         ":CommonFolders",
         ":IR",
         ":InferIntRangeCommon",
@@ -10795,6 +10799,7 @@ cc_library(
         ":ArithDialect",
         ":ArithUtils",
         ":BytecodeOpInterface",
+        ":CastInterfaces",
         ":ComplexDialect",
         ":ControlFlowInterfaces",
         ":CopyOpInterface",

diff  --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
index fa848f0cacfed..c546a70dcc2fe 100644
--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch4/BUILD.bazel
@@ -96,7 +96,7 @@ cc_binary(
         ":ToyOpsIncGen",
         "//llvm:Support",
         "//mlir:Analysis",
-        "//mlir:CastOpInterfaces",
+        "//mlir:CastInterfaces",
         "//mlir:IR",
         "//mlir:Parser",
         "//mlir:Pass",

diff  --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
index 12b4a31c1c0dd..d9afeb722e475 100644
--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch5/BUILD.bazel
@@ -101,7 +101,7 @@ cc_binary(
         "//mlir:AllPassesAndDialects",
         "//mlir:Analysis",
         "//mlir:ArithDialect",
-        "//mlir:CastOpInterfaces",
+        "//mlir:CastInterfaces",
         "//mlir:FuncDialect",
         "//mlir:IR",
         "//mlir:MemRefDialect",

diff  --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
index 7b48716aacded..8dfa349080cff 100644
--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch6/BUILD.bazel
@@ -106,7 +106,7 @@ cc_binary(
         "//mlir:ArithDialect",
         "//mlir:ArithToLLVM",
         "//mlir:BuiltinToLLVMIRTranslation",
-        "//mlir:CastOpInterfaces",
+        "//mlir:CastInterfaces",
         "//mlir:ControlFlowToLLVM",
         "//mlir:ExecutionEngine",
         "//mlir:ExecutionEngineUtils",

diff  --git a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
index 7ddc237542181..5030f8940034e 100644
--- a/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/examples/toy/Ch7/BUILD.bazel
@@ -106,7 +106,7 @@ cc_binary(
         "//mlir:ArithDialect",
         "//mlir:ArithToLLVM",
         "//mlir:BuiltinToLLVMIRTranslation",
-        "//mlir:CastOpInterfaces",
+        "//mlir:CastInterfaces",
         "//mlir:ControlFlowToLLVM",
         "//mlir:ExecutionEngine",
         "//mlir:ExecutionEngineUtils",

diff  --git a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
index 8263a8e4e7664..d0cf4c99566b9 100644
--- a/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel
@@ -962,6 +962,7 @@ cc_library(
     deps = [
         ":TestDialect",
         ":TestPDLLPatternsIncGen",
+        "//mlir:CastInterfaces",
         "//mlir:IR",
         "//mlir:PDLDialect",
         "//mlir:PDLInterpDialect",


        


More information about the Mlir-commits mailing list