MLIR  19.0.0git
LoopLikeInterface.h
Go to the documentation of this file.
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 
18 namespace mlir {
19 class 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`.
25 using NewYieldValuesFn = std::function<SmallVector<Value>(
26  OpBuilder &b, Location loc, ArrayRef<BlockArgument> newBbArgs)>;
27 
28 namespace detail {
29 /// Verify invariants of the LoopLikeOpInterface.
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_
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition: Location.h:63
This class helps build Operations.
Definition: Builders.h:209
Operation is the basic unit of execution within MLIR.
Definition: Operation.h:88
LogicalResult verifyLoopLikeOpInterface(Operation *op)
Verify invariants of the LoopLikeOpInterface.
Include the generated interface declarations.
std::function< SmallVector< Value >(OpBuilder &b, Location loc, ArrayRef< BlockArgument > newBbArgs)> NewYieldValuesFn
A function that returns the additional yielded values during replaceWithAdditionalYields.
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26