[mlir] remove RegionBranchOpInterface from linalg ops
authorAlex Zinenko <zinenko@google.com>
Thu, 20 Jul 2023 13:53:51 +0000 (13:53 +0000)
committerAlex Zinenko <zinenko@google.com>
Fri, 21 Jul 2023 08:18:41 +0000 (08:18 +0000)
Linalg structure ops do not implement control flow in the way expected
by RegionBranchOpInterface, and the interface implementation isn't
actually used anywhere. The presence of this interface without correct
implementation is confusing for, e.g., dataflow analyses.

Reviewed By: springerm

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

mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td

index dd2a943..c8d5799 100644 (file)
@@ -16,7 +16,6 @@
 
 include "mlir/Dialect/Linalg/IR/LinalgBase.td"
 include "mlir/Dialect/Linalg/IR/LinalgInterfaces.td"
-include "mlir/Interfaces/ControlFlowInterfaces.td"
 include "mlir/Interfaces/DestinationStyleOpInterface.td"
 include "mlir/Interfaces/InferTypeOpInterface.td"
 include "mlir/Interfaces/SideEffectInterfaces.td"
@@ -32,7 +31,6 @@ class LinalgStructuredBase_Op<string mnemonic, list<Trait> props>
        DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
        DestinationStyleOpInterface,
        LinalgStructuredInterface,
-       RegionBranchOpInterface,
        ReifyRankedShapedTypeOpInterface], props)> {
   code structuredOpsBaseDecls = [{
     // Return whether the op accesses the iteration indices.
@@ -45,13 +43,6 @@ class LinalgStructuredBase_Op<string mnemonic, list<Trait> props>
       return llvm::cast<LinalgOp>(getOperation()).reifyResultShapes(b,
           reifiedReturnShapes);
     }
-
-    void getSuccessorRegions(
-        std::optional<unsigned> index, ArrayRef<Attribute> operands,
-        SmallVectorImpl<RegionSuccessor> &regions) {
-      // Op has a region, but conceptually the control flow does not enter the
-      // region.
-    }
   }];
 }