[Mlir-commits] [mlir] 7ce1e7a - [mlir][NFC] Move the operation interfaces out of Analysis/ and into a new Interfaces/ directory.
River Riddle
llvmlistbot at llvm.org
Tue Mar 10 12:48:48 PDT 2020
Author: River Riddle
Date: 2020-03-10T12:45:45-07:00
New Revision: 7ce1e7ab075abf64409bc135aa9a4b0bec59fdf7
URL: https://github.com/llvm/llvm-project/commit/7ce1e7ab075abf64409bc135aa9a4b0bec59fdf7
DIFF: https://github.com/llvm/llvm-project/commit/7ce1e7ab075abf64409bc135aa9a4b0bec59fdf7.diff
LOG: [mlir][NFC] Move the operation interfaces out of Analysis/ and into a new Interfaces/ directory.
The interfaces themselves aren't really analyses, they may be used by analyses though. Having them in Analysis can also create cyclic dependencies if an analysis depends on a specific dialect, that also provides one of the interfaces.
Differential Revision: https://reviews.llvm.org/D75867
Added:
mlir/include/mlir/Interfaces/CMakeLists.txt
mlir/include/mlir/Interfaces/CallInterfaces.h
mlir/include/mlir/Interfaces/CallInterfaces.td
mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
mlir/include/mlir/Interfaces/InferTypeOpInterface.h
mlir/include/mlir/Interfaces/InferTypeOpInterface.td
mlir/lib/Interfaces/CMakeLists.txt
mlir/lib/Interfaces/CallInterfaces.cpp
mlir/lib/Interfaces/ControlFlowInterfaces.cpp
mlir/lib/Interfaces/InferTypeOpInterface.cpp
Modified:
mlir/docs/ShapeInference.md
mlir/docs/Tutorials/Toy/Ch-4.md
mlir/examples/toy/Ch4/CMakeLists.txt
mlir/examples/toy/Ch4/include/toy/Ops.td
mlir/examples/toy/Ch5/CMakeLists.txt
mlir/examples/toy/Ch5/include/toy/Ops.td
mlir/examples/toy/Ch6/CMakeLists.txt
mlir/examples/toy/Ch6/include/toy/Ops.td
mlir/examples/toy/Ch7/CMakeLists.txt
mlir/examples/toy/Ch7/include/toy/Ops.td
mlir/include/mlir/CMakeLists.txt
mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
mlir/include/mlir/IR/Function.h
mlir/lib/Analysis/CMakeLists.txt
mlir/lib/Analysis/CallGraph.cpp
mlir/lib/CMakeLists.txt
mlir/lib/Dialect/LLVMIR/CMakeLists.txt
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/lib/Dialect/StandardOps/CMakeLists.txt
mlir/lib/IR/CMakeLists.txt
mlir/lib/Transforms/Utils/RegionUtils.cpp
mlir/test/lib/IR/CMakeLists.txt
mlir/test/lib/TestDialect/CMakeLists.txt
mlir/test/lib/TestDialect/TestDialect.h
mlir/test/lib/TestDialect/TestOps.td
Removed:
mlir/include/mlir/Analysis/CMakeLists.txt
mlir/include/mlir/Analysis/CallInterfaces.h
mlir/include/mlir/Analysis/CallInterfaces.td
mlir/include/mlir/Analysis/ControlFlowInterfaces.h
mlir/include/mlir/Analysis/ControlFlowInterfaces.td
mlir/include/mlir/Analysis/InferTypeOpInterface.h
mlir/include/mlir/Analysis/InferTypeOpInterface.td
mlir/lib/Analysis/ControlFlowInterfaces.cpp
mlir/lib/Analysis/InferTypeOpInterface.cpp
################################################################################
diff --git a/mlir/docs/ShapeInference.md b/mlir/docs/ShapeInference.md
index 09737855f8ef..cbe544ceef89 100644
--- a/mlir/docs/ShapeInference.md
+++ b/mlir/docs/ShapeInference.md
@@ -291,5 +291,5 @@ function, the reference implementation of the operation will be used to derive
the shape function. The reference implementation is general and can support the
arbitrary computations needed to specify output shapes.
-[InferTypeOpInterface]: https://github.com/llvm/llvm-project/tree/master/mlir/include/mlir/Analysis/InferTypeOpInterface.td
+[InferTypeOpInterface]: https://github.com/llvm/llvm-project/tree/master/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
[ShapedType]: https://github.com/llvm/llvm-project/tree/master/mlir/include/mlir/IR/StandardTypes.h
diff --git a/mlir/docs/Tutorials/Toy/Ch-4.md b/mlir/docs/Tutorials/Toy/Ch-4.md
index 34a4b88c0227..c9a5d8188f9d 100644
--- a/mlir/docs/Tutorials/Toy/Ch-4.md
+++ b/mlir/docs/Tutorials/Toy/Ch-4.md
@@ -108,7 +108,7 @@ To add this interface we just need to include the definition into our operation
specification file (`Ops.td`):
```tablegen
-include "mlir/Analysis/CallInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
```
and add it to the traits list of `GenericCallOp`:
diff --git a/mlir/examples/toy/Ch4/CMakeLists.txt b/mlir/examples/toy/Ch4/CMakeLists.txt
index a78bedfd8814..a12c1df7a2a1 100644
--- a/mlir/examples/toy/Ch4/CMakeLists.txt
+++ b/mlir/examples/toy/Ch4/CMakeLists.txt
@@ -20,7 +20,6 @@ add_toy_chapter(toyc-ch4
ToyCh4OpsIncGen
ToyCh4ShapeInferenceInterfaceIncGen
ToyCh4CombineIncGen
- MLIRCallOpInterfacesIncGen
)
include_directories(include/)
@@ -29,6 +28,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
target_link_libraries(toyc-ch4
PRIVATE
MLIRAnalysis
+ MLIRCallInterfaces
MLIRIR
MLIRParser
MLIRPass
diff --git a/mlir/examples/toy/Ch4/include/toy/Ops.td b/mlir/examples/toy/Ch4/include/toy/Ops.td
index c805039c2f10..56539cab7e4d 100644
--- a/mlir/examples/toy/Ch4/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch4/include/toy/Ops.td
@@ -13,7 +13,7 @@
#ifndef TOY_OPS
#define TOY_OPS
-include "mlir/Analysis/CallInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
include "toy/ShapeInferenceInterface.td"
// Provide a definition of the 'toy' dialect in the ODS framework so that we
diff --git a/mlir/examples/toy/Ch5/CMakeLists.txt b/mlir/examples/toy/Ch5/CMakeLists.txt
index c5f5def5bf00..065f8ab4f353 100644
--- a/mlir/examples/toy/Ch5/CMakeLists.txt
+++ b/mlir/examples/toy/Ch5/CMakeLists.txt
@@ -21,7 +21,6 @@ add_toy_chapter(toyc-ch5
ToyCh5ShapeInferenceInterfaceIncGen
ToyCh5OpsIncGen
ToyCh5CombineIncGen
- MLIRCallOpInterfacesIncGen
)
include_directories(include/)
@@ -32,6 +31,7 @@ target_link_libraries(toyc-ch5
PRIVATE
${dialect_libs}
MLIRAnalysis
+ MLIRCallInterfaces
MLIRIR
MLIRParser
MLIRPass
diff --git a/mlir/examples/toy/Ch5/include/toy/Ops.td b/mlir/examples/toy/Ch5/include/toy/Ops.td
index 84fbdb558669..77b0712cd5e2 100644
--- a/mlir/examples/toy/Ch5/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch5/include/toy/Ops.td
@@ -13,7 +13,7 @@
#ifndef TOY_OPS
#define TOY_OPS
-include "mlir/Analysis/CallInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
include "toy/ShapeInferenceInterface.td"
// Provide a definition of the 'toy' dialect in the ODS framework so that we
diff --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt
index 9b1e8aeec28d..1dbbe1d6abb3 100644
--- a/mlir/examples/toy/Ch6/CMakeLists.txt
+++ b/mlir/examples/toy/Ch6/CMakeLists.txt
@@ -23,7 +23,6 @@ add_toy_chapter(toyc-ch6
ToyCh6ShapeInferenceInterfaceIncGen
ToyCh6OpsIncGen
ToyCh6CombineIncGen
- MLIRCallOpInterfacesIncGen
)
include_directories(include/)
@@ -36,6 +35,7 @@ target_link_libraries(toyc-ch6
${dialect_libs}
${conversion_libs}
MLIRAnalysis
+ MLIRCallInterfaces
MLIRExecutionEngine
MLIRIR
MLIRLLVMIR
diff --git a/mlir/examples/toy/Ch6/include/toy/Ops.td b/mlir/examples/toy/Ch6/include/toy/Ops.td
index 5b95e0cfb37e..d39c9129018e 100644
--- a/mlir/examples/toy/Ch6/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch6/include/toy/Ops.td
@@ -13,7 +13,7 @@
#ifndef TOY_OPS
#define TOY_OPS
-include "mlir/Analysis/CallInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
include "toy/ShapeInferenceInterface.td"
// Provide a definition of the 'toy' dialect in the ODS framework so that we
diff --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt
index cc1e9bf7bc99..7fd7f83bc7db 100644
--- a/mlir/examples/toy/Ch7/CMakeLists.txt
+++ b/mlir/examples/toy/Ch7/CMakeLists.txt
@@ -23,7 +23,6 @@ add_toy_chapter(toyc-ch7
ToyCh7ShapeInferenceInterfaceIncGen
ToyCh7OpsIncGen
ToyCh7CombineIncGen
- MLIRCallOpInterfacesIncGen
)
include_directories(include/)
@@ -36,6 +35,7 @@ target_link_libraries(toyc-ch7
${dialect_libs}
${conversion_libs}
MLIRAnalysis
+ MLIRCallInterfaces
MLIRExecutionEngine
MLIRIR
MLIRParser
diff --git a/mlir/examples/toy/Ch7/include/toy/Ops.td b/mlir/examples/toy/Ch7/include/toy/Ops.td
index d2d369d5fccb..75019c775074 100644
--- a/mlir/examples/toy/Ch7/include/toy/Ops.td
+++ b/mlir/examples/toy/Ch7/include/toy/Ops.td
@@ -13,7 +13,7 @@
#ifndef TOY_OPS
#define TOY_OPS
-include "mlir/Analysis/CallInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
include "toy/ShapeInferenceInterface.td"
// Provide a definition of the 'toy' dialect in the ODS framework so that we
diff --git a/mlir/include/mlir/CMakeLists.txt b/mlir/include/mlir/CMakeLists.txt
index 84031a5e72a7..367207157415 100644
--- a/mlir/include/mlir/CMakeLists.txt
+++ b/mlir/include/mlir/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_subdirectory(Analysis)
add_subdirectory(Dialect)
add_subdirectory(IR)
+add_subdirectory(Interfaces)
add_subdirectory(Transforms)
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
index a8b0be0793d6..1c37b556d104 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
@@ -14,13 +14,13 @@
#ifndef MLIR_DIALECT_LLVMIR_LLVMDIALECT_H_
#define MLIR_DIALECT_LLVMIR_LLVMDIALECT_H_
-#include "mlir/Analysis/ControlFlowInterfaces.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/Function.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/TypeSupport.h"
#include "mlir/IR/Types.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
index 1fb5bd92b7f8..d04c8d2ca280 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
@@ -14,7 +14,7 @@
#define LLVMIR_OPS
include "mlir/Dialect/LLVMIR/LLVMOpBase.td"
-include "mlir/Analysis/ControlFlowInterfaces.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
class LLVM_Builder<string builder> {
string llvmBuilder = builder;
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
index 704db7c05bf1..c2312b8096e4 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
@@ -15,8 +15,8 @@
#define SPIRV_CONTROLFLOW_OPS
include "mlir/Dialect/SPIRV/SPIRVBase.td"
-include "mlir/Analysis/CallInterfaces.td"
-include "mlir/Analysis/ControlFlowInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
// -----
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
index e223f17933f3..89b0be92f367 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
@@ -13,9 +13,9 @@
#ifndef MLIR_DIALECT_SPIRV_SPIRVOPS_H_
#define MLIR_DIALECT_SPIRV_SPIRVOPS_H_
-#include "mlir/Analysis/ControlFlowInterfaces.h"
#include "mlir/Dialect/SPIRV/SPIRVTypes.h"
#include "mlir/IR/Function.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
namespace mlir {
diff --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
index c043d0c09870..89480664534f 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
@@ -15,7 +15,7 @@
#ifndef SPIRV_STRUCTURE_OPS
#define SPIRV_STRUCTURE_OPS
-include "mlir/Analysis/CallInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
include "mlir/Dialect/SPIRV/SPIRVBase.td"
// -----
diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.h b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
index 10822764ff6d..781fd39ea4c2 100644
--- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
+++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
@@ -14,12 +14,12 @@
#ifndef MLIR_DIALECT_STANDARDOPS_IR_OPS_H
#define MLIR_DIALECT_STANDARDOPS_IR_OPS_H
-#include "mlir/Analysis/CallInterfaces.h"
-#include "mlir/Analysis/ControlFlowInterfaces.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/StandardTypes.h"
+#include "mlir/Interfaces/CallInterfaces.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
// Pull in all enum type definitions and utility function declarations.
#include "mlir/Dialect/StandardOps/IR/OpsEnums.h.inc"
diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
index 50735d54f19a..dabbca80bc73 100644
--- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
+++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
@@ -13,8 +13,8 @@
#ifndef STANDARD_OPS
#define STANDARD_OPS
-include "mlir/Analysis/CallInterfaces.td"
-include "mlir/Analysis/ControlFlowInterfaces.td"
+include "mlir/Interfaces/CallInterfaces.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
include "mlir/IR/OpAsmInterface.td"
include "mlir/IR/SideEffects.td"
diff --git a/mlir/include/mlir/IR/Function.h b/mlir/include/mlir/IR/Function.h
index 62384fea1f91..49c0c7c61284 100644
--- a/mlir/include/mlir/IR/Function.h
+++ b/mlir/include/mlir/IR/Function.h
@@ -13,11 +13,11 @@
#ifndef MLIR_IR_FUNCTION_H
#define MLIR_IR_FUNCTION_H
-#include "mlir/Analysis/CallInterfaces.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/FunctionSupport.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/SymbolTable.h"
+#include "mlir/Interfaces/CallInterfaces.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
namespace mlir {
diff --git a/mlir/include/mlir/Analysis/CMakeLists.txt b/mlir/include/mlir/Interfaces/CMakeLists.txt
similarity index 84%
rename from mlir/include/mlir/Analysis/CMakeLists.txt
rename to mlir/include/mlir/Interfaces/CMakeLists.txt
index cc8c4939b73b..4a4f67c7d770 100644
--- a/mlir/include/mlir/Analysis/CMakeLists.txt
+++ b/mlir/include/mlir/Interfaces/CMakeLists.txt
@@ -1,7 +1,7 @@
set(LLVM_TARGET_DEFINITIONS CallInterfaces.td)
mlir_tablegen(CallInterfaces.h.inc -gen-op-interface-decls)
mlir_tablegen(CallInterfaces.cpp.inc -gen-op-interface-defs)
-add_public_tablegen_target(MLIRCallOpInterfacesIncGen)
+add_public_tablegen_target(MLIRCallInterfacesIncGen)
set(LLVM_TARGET_DEFINITIONS ControlFlowInterfaces.td)
mlir_tablegen(ControlFlowInterfaces.h.inc -gen-op-interface-decls)
@@ -11,4 +11,4 @@ add_public_tablegen_target(MLIRControlFlowInterfacesIncGen)
set(LLVM_TARGET_DEFINITIONS InferTypeOpInterface.td)
mlir_tablegen(InferTypeOpInterface.h.inc -gen-op-interface-decls)
mlir_tablegen(InferTypeOpInterface.cpp.inc -gen-op-interface-defs)
-add_public_tablegen_target(MLIRTypeInferOpInterfaceIncGen)
+add_public_tablegen_target(MLIRInferTypeOpInterfaceIncGen)
diff --git a/mlir/include/mlir/Analysis/CallInterfaces.h b/mlir/include/mlir/Interfaces/CallInterfaces.h
similarity index 84%
rename from mlir/include/mlir/Analysis/CallInterfaces.h
rename to mlir/include/mlir/Interfaces/CallInterfaces.h
index ebefc88e21a9..ddfd5a942e49 100644
--- a/mlir/include/mlir/Analysis/CallInterfaces.h
+++ b/mlir/include/mlir/Interfaces/CallInterfaces.h
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_ANALYSIS_CALLINTERFACES_H
-#define MLIR_ANALYSIS_CALLINTERFACES_H
+#ifndef MLIR_INTERFACES_CALLINTERFACES_H
+#define MLIR_INTERFACES_CALLINTERFACES_H
#include "mlir/IR/SymbolTable.h"
#include "llvm/ADT/PointerUnion.h"
@@ -24,7 +24,7 @@ struct CallInterfaceCallable : public PointerUnion<SymbolRefAttr, Value> {
using PointerUnion<SymbolRefAttr, Value>::PointerUnion;
};
-#include "mlir/Analysis/CallInterfaces.h.inc"
+#include "mlir/Interfaces/CallInterfaces.h.inc"
} // end namespace mlir
-#endif // MLIR_ANALYSIS_CALLINTERFACES_H
+#endif // MLIR_INTERFACES_CALLINTERFACES_H
diff --git a/mlir/include/mlir/Analysis/CallInterfaces.td b/mlir/include/mlir/Interfaces/CallInterfaces.td
similarity index 94%
rename from mlir/include/mlir/Analysis/CallInterfaces.td
rename to mlir/include/mlir/Interfaces/CallInterfaces.td
index 2bc59c224b4f..0ff189de6800 100644
--- a/mlir/include/mlir/Analysis/CallInterfaces.td
+++ b/mlir/include/mlir/Interfaces/CallInterfaces.td
@@ -1,4 +1,4 @@
-//===- CallInterfaces.td - Call Interfaces for ops -*- tablegen ---------*-===//
+//===- CallInterfaces.td - Call Interfaces for ops ---------*- tablegen -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -12,8 +12,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_CALLINTERFACES
-#define MLIR_CALLINTERFACES
+#ifndef MLIR_INTERFACES_CALLINTERFACES
+#define MLIR_INTERFACES_CALLINTERFACES
include "mlir/IR/OpBase.td"
@@ -87,4 +87,4 @@ def CallableOpInterface : OpInterface<"CallableOpInterface"> {
];
}
-#endif // MLIR_CALLINTERFACES
+#endif // MLIR_INTERFACES_CALLINTERFACES
diff --git a/mlir/include/mlir/Analysis/ControlFlowInterfaces.h b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
similarity index 88%
rename from mlir/include/mlir/Analysis/ControlFlowInterfaces.h
rename to mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
index 87f82040ed61..661d2ec029ff 100644
--- a/mlir/include/mlir/Analysis/ControlFlowInterfaces.h
+++ b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_ANALYSIS_CONTROLFLOWINTERFACES_H
-#define MLIR_ANALYSIS_CONTROLFLOWINTERFACES_H
+#ifndef MLIR_INTERFACES_CONTROLFLOWINTERFACES_H
+#define MLIR_INTERFACES_CONTROLFLOWINTERFACES_H
#include "mlir/IR/OpDefinition.h"
@@ -37,7 +37,7 @@ LogicalResult verifyBranchSuccessorOperands(Operation *op, unsigned succNo,
Optional<OperandRange> operands);
} // namespace detail
-#include "mlir/Analysis/ControlFlowInterfaces.h.inc"
+#include "mlir/Interfaces/ControlFlowInterfaces.h.inc"
} // end namespace mlir
-#endif // MLIR_ANALYSIS_CONTROLFLOWINTERFACES_H
+#endif // MLIR_INTERFACES_CONTROLFLOWINTERFACES_H
diff --git a/mlir/include/mlir/Analysis/ControlFlowInterfaces.td b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
similarity index 95%
rename from mlir/include/mlir/Analysis/ControlFlowInterfaces.td
rename to mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
index b34b7a9d7e81..387c694e6a86 100644
--- a/mlir/include/mlir/Analysis/ControlFlowInterfaces.td
+++ b/mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_ANALYSIS_CONTROLFLOWINTERFACES
-#define MLIR_ANALYSIS_CONTROLFLOWINTERFACES
+#ifndef MLIR_INTERFACES_CONTROLFLOWINTERFACES
+#define MLIR_INTERFACES_CONTROLFLOWINTERFACES
include "mlir/IR/OpBase.td"
@@ -82,4 +82,4 @@ def BranchOpInterface : OpInterface<"BranchOpInterface"> {
}];
}
-#endif // MLIR_ANALYSIS_CONTROLFLOWINTERFACES
+#endif // MLIR_INTERFACES_CONTROLFLOWINTERFACES
diff --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.h b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
similarity index 95%
rename from mlir/include/mlir/Analysis/InferTypeOpInterface.h
rename to mlir/include/mlir/Interfaces/InferTypeOpInterface.h
index 26323e430a43..0da1125dfc4b 100644
--- a/mlir/include/mlir/Analysis/InferTypeOpInterface.h
+++ b/mlir/include/mlir/Interfaces/InferTypeOpInterface.h
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef MLIR_ANALYSIS_INFERTYPEOPINTERFACE_H_
-#define MLIR_ANALYSIS_INFERTYPEOPINTERFACE_H_
+#ifndef MLIR_INTERFACES_INFERTYPEOPINTERFACE_H_
+#define MLIR_INTERFACES_INFERTYPEOPINTERFACE_H_
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h"
@@ -94,7 +94,7 @@ LogicalResult inferReturnTensorTypes(
LogicalResult verifyInferredResultTypes(Operation *op);
} // namespace detail
-#include "mlir/Analysis/InferTypeOpInterface.h.inc"
+#include "mlir/Interfaces/InferTypeOpInterface.h.inc"
namespace OpTrait {
@@ -118,4 +118,4 @@ class InferTensorType : public TraitBase<ConcreteType, InferTensorType> {
} // namespace OpTrait
} // namespace mlir
-#endif // MLIR_ANALYSIS_INFERTYPEOPINTERFACE_H_
+#endif // MLIR_INTERFACES_INFERTYPEOPINTERFACE_H_
diff --git a/mlir/include/mlir/Analysis/InferTypeOpInterface.td b/mlir/include/mlir/Interfaces/InferTypeOpInterface.td
similarity index 100%
rename from mlir/include/mlir/Analysis/InferTypeOpInterface.td
rename to mlir/include/mlir/Interfaces/InferTypeOpInterface.td
diff --git a/mlir/lib/Analysis/CMakeLists.txt b/mlir/lib/Analysis/CMakeLists.txt
index 750281eb4e6e..f9c0236e3d4e 100644
--- a/mlir/lib/Analysis/CMakeLists.txt
+++ b/mlir/lib/Analysis/CMakeLists.txt
@@ -2,9 +2,7 @@ set(LLVM_OPTIONAL_SOURCES
AffineAnalysis.cpp
AffineStructures.cpp
CallGraph.cpp
- ControlFlowInterfaces.cpp
Dominance.cpp
- InferTypeOpInterface.cpp
Liveness.cpp
LoopAnalysis.cpp
NestedMatcher.cpp
@@ -13,23 +11,8 @@ set(LLVM_OPTIONAL_SOURCES
Verifier.cpp
)
-add_mlir_library(MLIRControlFlowAnalysis
- ControlFlowInterfaces.cpp
-
- ADDITIONAL_HEADER_DIRS
- ${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
-
- DEPENDS
- MLIRControlFlowInterfacesIncGen
- )
-target_link_libraries(MLIRControlFlowAnalysis
- PUBLIC
- MLIRIR
- )
-
add_mlir_library(MLIRAnalysis
CallGraph.cpp
- InferTypeOpInterface.cpp
Liveness.cpp
SliceAnalysis.cpp
Dominance.cpp
@@ -37,15 +20,14 @@ add_mlir_library(MLIRAnalysis
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
-
- DEPENDS
- MLIRCallOpInterfacesIncGen
- MLIRTypeInferOpInterfaceIncGen
)
target_link_libraries(MLIRAnalysis
PUBLIC
MLIRAffineOps
+ MLIRCallInterfaces
+ MLIRControlFlowInterfaces
+ MLIRInferTypeOpInterface
MLIRLoopOps
)
@@ -58,13 +40,12 @@ add_mlir_library(MLIRLoopAnalysis
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Analysis
-
- DEPENDS
- MLIRCallOpInterfacesIncGen
- MLIRTypeInferOpInterfaceIncGen
)
target_link_libraries(MLIRLoopAnalysis
PUBLIC
MLIRAffineOps
+ MLIRCallInterfaces
+ MLIRControlFlowInterfaces
+ MLIRInferTypeOpInterface
MLIRLoopOps)
diff --git a/mlir/lib/Analysis/CallGraph.cpp b/mlir/lib/Analysis/CallGraph.cpp
index d61b2359e691..1a31f1347135 100644
--- a/mlir/lib/Analysis/CallGraph.cpp
+++ b/mlir/lib/Analysis/CallGraph.cpp
@@ -11,21 +11,15 @@
//===----------------------------------------------------------------------===//
#include "mlir/Analysis/CallGraph.h"
-#include "mlir/Analysis/CallInterfaces.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/SymbolTable.h"
+#include "mlir/Interfaces/CallInterfaces.h"
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/Support/raw_ostream.h"
using namespace mlir;
-//===----------------------------------------------------------------------===//
-// CallInterfaces
-//===----------------------------------------------------------------------===//
-
-#include "mlir/Analysis/CallInterfaces.cpp.inc"
-
//===----------------------------------------------------------------------===//
// CallGraphNode
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/CMakeLists.txt b/mlir/lib/CMakeLists.txt
index f34b1e8bead2..4810ecf050d1 100644
--- a/mlir/lib/CMakeLists.txt
+++ b/mlir/lib/CMakeLists.txt
@@ -4,6 +4,7 @@ add_subdirectory(Dialect)
add_subdirectory(EDSC)
add_subdirectory(ExecutionEngine)
add_subdirectory(IR)
+add_subdirectory(Interfaces)
add_subdirectory(Parser)
add_subdirectory(Pass)
add_subdirectory(Quantizer)
diff --git a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
index c9b739523cb4..3c630287793b 100644
--- a/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
+++ b/mlir/lib/Dialect/LLVMIR/CMakeLists.txt
@@ -5,7 +5,6 @@ add_mlir_dialect_library(MLIRLLVMIR
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/LLVMIR
DEPENDS
- MLIRControlFlowInterfacesIncGen
MLIRLLVMOpsIncGen
MLIRLLVMConversionsIncGen
)
@@ -15,7 +14,8 @@ target_link_libraries(MLIRLLVMIR
LLVMCore
LLVMSupport
LLVMFrontendOpenMP
- MLIRAnalysis
+ MLIRCallInterfaces
+ MLIRControlFlowInterfaces
MLIROpenMP
MLIRIR
MLIRSupport
diff --git a/mlir/lib/Dialect/SPIRV/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/CMakeLists.txt
index 16c96590cbc4..cb378a0e1ace 100644
--- a/mlir/lib/Dialect/SPIRV/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/CMakeLists.txt
@@ -15,7 +15,6 @@ add_mlir_dialect_library(MLIRSPIRV
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/SPIRV
DEPENDS
- MLIRControlFlowInterfacesIncGen
MLIRSPIRVAvailabilityIncGen
MLIRSPIRVCanonicalizationIncGen
MLIRSPIRVEnumAvailabilityIncGen
@@ -26,6 +25,7 @@ add_mlir_dialect_library(MLIRSPIRV
)
target_link_libraries(MLIRSPIRV
PUBLIC
+ MLIRControlFlowInterfaces
MLIRIR
MLIRParser
MLIRSupport
diff --git a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
index 3642f47a2bcc..25da3b80abfc 100644
--- a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
+++ b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
@@ -12,7 +12,6 @@
#include "mlir/Dialect/SPIRV/SPIRVOps.h"
-#include "mlir/Analysis/CallInterfaces.h"
#include "mlir/Dialect/SPIRV/SPIRVDialect.h"
#include "mlir/Dialect/SPIRV/SPIRVTypes.h"
#include "mlir/IR/Builders.h"
@@ -20,6 +19,7 @@
#include "mlir/IR/FunctionImplementation.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/StandardTypes.h"
+#include "mlir/Interfaces/CallInterfaces.h"
#include "mlir/Support/StringExtras.h"
#include "llvm/ADT/bit.h"
diff --git a/mlir/lib/Dialect/StandardOps/CMakeLists.txt b/mlir/lib/Dialect/StandardOps/CMakeLists.txt
index 02f1da8c089e..d5e535642bd8 100644
--- a/mlir/lib/Dialect/StandardOps/CMakeLists.txt
+++ b/mlir/lib/Dialect/StandardOps/CMakeLists.txt
@@ -7,13 +7,12 @@ add_mlir_dialect_library(MLIRStandardOps
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/StandardOps
DEPENDS
- MLIRCallOpInterfacesIncGen
- MLIRControlFlowInterfacesIncGen
MLIRStandardOpsIncGen
)
target_link_libraries(MLIRStandardOps
PUBLIC
- MLIRControlFlowAnalysis
+ MLIRCallInterfaces
+ MLIRControlFlowInterfaces
MLIREDSC
MLIRIR
LLVMSupport
diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt
index 3f7a42231fe2..ed402448a7df 100644
--- a/mlir/lib/IR/CMakeLists.txt
+++ b/mlir/lib/IR/CMakeLists.txt
@@ -6,7 +6,7 @@ add_mlir_library(MLIRIR
${MLIR_MAIN_INCLUDE_DIR}/mlir/IR
DEPENDS
- MLIRCallOpInterfacesIncGen
+ MLIRCallInterfacesIncGen
MLIRSideEffectOpInterfacesIncGen
MLIROpAsmInterfacesIncGen
)
diff --git a/mlir/lib/Interfaces/CMakeLists.txt b/mlir/lib/Interfaces/CMakeLists.txt
new file mode 100644
index 000000000000..ef3ebfcaa053
--- /dev/null
+++ b/mlir/lib/Interfaces/CMakeLists.txt
@@ -0,0 +1,47 @@
+set(LLVM_OPTIONAL_SOURCES
+ CallInterfaces.cpp
+ ControlFlowInterfaces.cpp
+ InferTypeOpInterface.cpp
+ )
+
+add_llvm_library(MLIRCallInterfaces
+ CallInterfaces.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Interfaces
+ )
+add_dependencies(MLIRCallInterfaces
+ MLIRCallInterfacesIncGen
+ )
+target_link_libraries(MLIRCallInterfaces
+ PUBLIC
+ MLIRIR
+ )
+
+add_llvm_library(MLIRControlFlowInterfaces
+ ControlFlowInterfaces.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Interfaces
+ )
+add_dependencies(MLIRControlFlowInterfaces
+ MLIRControlFlowInterfacesIncGen
+ )
+target_link_libraries(MLIRControlFlowInterfaces
+ PUBLIC
+ MLIRIR
+ )
+
+add_llvm_library(MLIRInferTypeOpInterface
+ InferTypeOpInterface.cpp
+
+ ADDITIONAL_HEADER_DIRS
+ ${MLIR_MAIN_INCLUDE_DIR}/mlir/Interfaces
+ )
+add_dependencies(MLIRInferTypeOpInterface
+ MLIRInferTypeOpInterfaceIncGen
+ )
+target_link_libraries(MLIRInferTypeOpInterface
+ PUBLIC
+ MLIRIR
+ )
diff --git a/mlir/lib/Interfaces/CallInterfaces.cpp b/mlir/lib/Interfaces/CallInterfaces.cpp
new file mode 100644
index 000000000000..580cd13de5ab
--- /dev/null
+++ b/mlir/lib/Interfaces/CallInterfaces.cpp
@@ -0,0 +1,17 @@
+//===- CallInterfaces.cpp - ControlFlow Interfaces ------------------------===//
+//
+// 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/Interfaces/CallInterfaces.h"
+
+using namespace mlir;
+
+//===----------------------------------------------------------------------===//
+// CallInterfaces
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Interfaces/CallInterfaces.cpp.inc"
diff --git a/mlir/lib/Analysis/ControlFlowInterfaces.cpp b/mlir/lib/Interfaces/ControlFlowInterfaces.cpp
similarity index 95%
rename from mlir/lib/Analysis/ControlFlowInterfaces.cpp
rename to mlir/lib/Interfaces/ControlFlowInterfaces.cpp
index 7d98f29d7cf6..746dd402a35a 100644
--- a/mlir/lib/Analysis/ControlFlowInterfaces.cpp
+++ b/mlir/lib/Interfaces/ControlFlowInterfaces.cpp
@@ -1,4 +1,4 @@
-//===- ControlFlowInterfaces.h - ControlFlow Interfaces -------------------===//
+//===- ControlFlowInterfaces.cpp - ControlFlow Interfaces -----------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Analysis/ControlFlowInterfaces.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/IR/StandardTypes.h"
using namespace mlir;
@@ -15,7 +15,7 @@ using namespace mlir;
// ControlFlowInterfaces
//===----------------------------------------------------------------------===//
-#include "mlir/Analysis/ControlFlowInterfaces.cpp.inc"
+#include "mlir/Interfaces/ControlFlowInterfaces.cpp.inc"
//===----------------------------------------------------------------------===//
// BranchOpInterface
diff --git a/mlir/lib/Analysis/InferTypeOpInterface.cpp b/mlir/lib/Interfaces/InferTypeOpInterface.cpp
similarity index 95%
rename from mlir/lib/Analysis/InferTypeOpInterface.cpp
rename to mlir/lib/Interfaces/InferTypeOpInterface.cpp
index 8cf8ec485e9f..ef73ce3021f8 100644
--- a/mlir/lib/Analysis/InferTypeOpInterface.cpp
+++ b/mlir/lib/Interfaces/InferTypeOpInterface.cpp
@@ -11,14 +11,14 @@
//
//===----------------------------------------------------------------------===//
-#include "mlir/Analysis/InferTypeOpInterface.h"
+#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "mlir/IR/StandardTypes.h"
using namespace mlir;
namespace mlir {
-#include "mlir/Analysis/InferTypeOpInterface.cpp.inc"
+#include "mlir/Interfaces/InferTypeOpInterface.cpp.inc"
} // namespace mlir
LogicalResult mlir::detail::inferReturnTensorTypes(
diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp
index 57535fec7380..78bb609b5c03 100644
--- a/mlir/lib/Transforms/Utils/RegionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp
@@ -7,11 +7,11 @@
//===----------------------------------------------------------------------===//
#include "mlir/Transforms/RegionUtils.h"
-#include "mlir/Analysis/ControlFlowInterfaces.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/RegionGraphTraits.h"
#include "mlir/IR/Value.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/PostOrderIterator.h"
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index 945a0f5efdcb..bf0f8eed4410 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -12,4 +12,5 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/../TestDialect)
target_link_libraries(MLIRTestIR
PUBLIC
MLIRPass
+ MLIRTestDialect
)
diff --git a/mlir/test/lib/TestDialect/CMakeLists.txt b/mlir/test/lib/TestDialect/CMakeLists.txt
index 102d4f9fc2a9..6424d5ab23e1 100644
--- a/mlir/test/lib/TestDialect/CMakeLists.txt
+++ b/mlir/test/lib/TestDialect/CMakeLists.txt
@@ -16,13 +16,11 @@ add_llvm_library(MLIRTestDialect
TestPatterns.cpp
DEPENDS
- MLIRControlFlowInterfacesIncGen
MLIRTestOpsIncGen
- MLIRTypeInferOpInterfaceIncGen
)
target_link_libraries(MLIRTestDialect
PUBLIC
- MLIRAnalysis
+ MLIRControlFlowInterfaces
MLIRDialect
MLIRIR
MLIRLinalgTransforms
@@ -30,5 +28,6 @@ target_link_libraries(MLIRTestDialect
MLIRStandardOps
MLIRTransforms
MLIRTransformUtils
+ MLIRInferTypeOpInterface
LLVMSupport
)
diff --git a/mlir/test/lib/TestDialect/TestDialect.h b/mlir/test/lib/TestDialect/TestDialect.h
index 8228f31434f5..a8a46e81ef19 100644
--- a/mlir/test/lib/TestDialect/TestDialect.h
+++ b/mlir/test/lib/TestDialect/TestDialect.h
@@ -14,15 +14,15 @@
#ifndef MLIR_TESTDIALECT_H
#define MLIR_TESTDIALECT_H
-#include "mlir/Analysis/CallInterfaces.h"
-#include "mlir/Analysis/ControlFlowInterfaces.h"
-#include "mlir/Analysis/InferTypeOpInterface.h"
#include "mlir/Dialect/Traits.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/StandardTypes.h"
#include "mlir/IR/SymbolTable.h"
+#include "mlir/Interfaces/CallInterfaces.h"
+#include "mlir/Interfaces/ControlFlowInterfaces.h"
+#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "TestOpEnums.h.inc"
diff --git a/mlir/test/lib/TestDialect/TestOps.td b/mlir/test/lib/TestDialect/TestOps.td
index f472aa0b4cde..ba38ec0306a2 100644
--- a/mlir/test/lib/TestDialect/TestOps.td
+++ b/mlir/test/lib/TestDialect/TestOps.td
@@ -12,9 +12,9 @@
include "mlir/IR/OpBase.td"
include "mlir/IR/OpAsmInterface.td"
include "mlir/IR/SideEffects.td"
-include "mlir/Analysis/ControlFlowInterfaces.td"
-include "mlir/Analysis/CallInterfaces.td"
-include "mlir/Analysis/InferTypeOpInterface.td"
+include "mlir/Interfaces/CallInterfaces.td"
+include "mlir/Interfaces/ControlFlowInterfaces.td"
+include "mlir/Interfaces/InferTypeOpInterface.td"
def TEST_Dialect : Dialect {
let name = "test";
More information about the Mlir-commits
mailing list