llvm-project/mlir/lib/Interfaces
Markus Böck 0c789db541 [mlir] Add support for operation-produced successor arguments in BranchOpInterface
This patch revamps the BranchOpInterface a bit and allows a proper implementation of what was previously `getMutableSuccessorOperands` for operations, which internally produce arguments to some of the block arguments. A motivating example for this would be an invoke op with a error handling path:
```
invoke %function(%0)
  label ^success ^error(%1 : i32)

^error(%e: !error, %arg0 : i32):
  ...
```
The advantages of this are that any users of `BranchOpInterface` can still argue over remaining block argument operands (such as `%1` in the example above), as well as make use of the modifying capabilities to add more operands, erase an operand etc.

The way this patch implements that functionality is via a new class called `SuccessorOperands`, which is now returned by `getSuccessorOperands`. It basically contains an `unsigned` denoting how many operator produced operands exist, as well as a `MutableOperandRange`, which are the usual forwarded operands we are used to. The produced operands are assumed to the first few block arguments, followed by the forwarded operands afterwards. The role of `SuccessorOperands` is to provide various utility functions to modify and query the successor arguments from a `BranchOpInterface`.

Differential Revision: https://reviews.llvm.org/D123062
2022-04-08 08:28:16 +02:00
..
CMakeLists.txt [mlir:LoopLikeInterface] Add missing dependency on SideEffectInterfaces 2022-01-24 21:13:31 -08:00
CallInterfaces.cpp [mlir] Update SCCP and the Inliner to use SymbolTableCollection for symbol lookups 2020-10-16 12:08:48 -07:00
CastInterfaces.cpp [mlir] Add an interface for Cast-Like operations 2021-01-20 16:28:17 -08:00
ControlFlowInterfaces.cpp [mlir] Add support for operation-produced successor arguments in BranchOpInterface 2022-04-08 08:28:16 +02:00
CopyOpInterface.cpp
DataLayoutInterfaces.cpp [mlir] Data layout for integer and float types 2022-03-02 14:56:49 +01:00
DerivedAttributeOpInterface.cpp
InferTypeOpInterface.cpp Apply clang-tidy fixes for performance-for-range-copy to MLIR (NFC) 2022-01-02 22:19:56 +00:00
LoopLikeInterface.cpp [mlir] Simplify LoopLikeOpInterface 2022-03-28 18:10:04 +00:00
SideEffectInterfaces.cpp Fix clang-tidy issues in mlir/ (NFC) 2021-12-20 20:25:01 +00:00
TilingInterface.cpp [mlir:TiingInterface] Remove unnecessary include of Tensor.h 2022-01-20 13:10:44 -08:00
VectorInterfaces.cpp [mlir][Vector] Thread 0-d vectors through vector.transfer ops 2021-12-01 16:49:43 +00:00
ViewLikeInterface.cpp [mlir] Rename `OpAsmParser::OperandType` to `OpAsmParser::UnresolvedOperand` 2022-03-21 21:42:13 +01:00