summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
diff options
context:
space:
mode:
authorMartin Erhart <merhart@google.com>2023-08-31 11:17:16 +0000
committerMartin Erhart <merhart@google.com>2023-08-31 11:28:23 +0000
commit34a35a8b244243f5a4ad5d531007bccfeaa0b02e (patch)
tree0838d6aafc1b55478d56e20cf9ec89b68330ea16 /mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
parent22044f0bde015f4bf53fca24831d030ff96efc51 (diff)
[mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface
Functions are always callable operations and thus every operation implementing the `FunctionOpInterface` also implements the `CallableOpInterface`. The only exception was the FuncOp in the toy example. To make implementation of the `FunctionOpInterface` easier, this commit lets `FunctionOpInterface` inherit from `CallableOpInterface` and merges some of their methods. More precisely, the `CallableOpInterface` has methods to get the argument and result attributes and a method to get the result types of the callable region. These methods are always implemented the same way as their analogues in `FunctionOpInterface` and thus this commit moves all the argument and result attribute handling methods to the callable interface as well as the methods to get the argument and result types. The `FuntionOpInterface` then does not have to declare them as well, but just inherits them from the `CallableOpInterface`. Adding the inheritance relation also required to move the `FunctionOpInterface` from the IR directory to the Interfaces directory since IR should not depend on Interfaces. Reviewed By: jpienaar, springerm Differential Revision: https://reviews.llvm.org/D157988
Diffstat (limited to 'mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp')
-rw-r--r--mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp b/mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
index 31ed5ad3b987..f8f754956603 100644
--- a/mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
+++ b/mlir/lib/Dialect/MLProgram/IR/MLProgramOps.cpp
@@ -8,7 +8,7 @@
#include "mlir/Dialect/MLProgram/IR/MLProgram.h"
#include "mlir/IR/Builders.h"
-#include "mlir/IR/FunctionImplementation.h"
+#include "mlir/Interfaces/FunctionImplementation.h"
using namespace mlir;
using namespace mlir::ml_program;