1//===- LoopLikeInterface.h - Loop-like operations interface ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the operation interface for loop like operations.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef MLIR_INTERFACES_LOOPLIKEINTERFACE_H_
14#define MLIR_INTERFACES_LOOPLIKEINTERFACE_H_
15
16#include "mlir/IR/OpDefinition.h"
17
18namespace mlir {
19class RewriterBase;
20
21/// A function that returns the additional yielded values during
22/// `replaceWithAdditionalYields`. `newBbArgs` are the newly added region
23/// iter_args. This function should return as many values as there are block
24/// arguments in `newBbArgs`.
25using NewYieldValuesFn = std::function<SmallVector<Value>(
26 OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBbArgs)>;
27
28namespace detail {
29/// Verify invariants of the LoopLikeOpInterface.
30LogicalResult verifyLoopLikeOpInterface(Operation *op);
31} // namespace detail
32} // namespace mlir
33
34/// Include the generated interface declarations.
35#include "mlir/Interfaces/LoopLikeInterface.h.inc"
36
37#endif // MLIR_INTERFACES_LOOPLIKEINTERFACE_H_
38

source code of mlir/include/mlir/Interfaces/LoopLikeInterface.h