|
MLIR 23.0.0git
|
Class encompassing various options related to cloning an operation. More...
#include "mlir/IR/Operation.h"
Public Member Functions | |
| CloneOptions () | |
| Default constructs an option with all flags set to false. | |
| CloneOptions (bool cloneRegions, bool cloneOperands, std::optional< SmallVector< Type > > resultTypes) | |
| Constructs an instance with the options set accordingly. | |
| CloneOptions & | cloneRegions (bool enable=true) |
| Configures whether cloning should traverse into any of the regions of the operation. | |
| bool | shouldCloneRegions () const |
| Returns whether regions of the operation should be cloned as well. | |
| CloneOptions & | cloneOperands (bool enable=true) |
| Configures whether operation' operands should be cloned. | |
| bool | shouldCloneOperands () const |
| Returns whether operands should be cloned as well. | |
| CloneOptions & | withResultTypes (std::optional< SmallVector< Type > > resultTypes) |
| Configures different result types to use for the cloned operation. | |
| bool | shouldCloneResults () const |
| Returns true if the results are cloned from the operation. | |
| TypeRange | resultTypesOr (TypeRange defaultResultTypes) const |
| Returns the result types that should be used for the created operation or defaultResultTypes if none were set. | |
Static Public Member Functions | |
| static CloneOptions | all () |
| Returns an instance such that all elements of the operation are cloned. | |
Class encompassing various options related to cloning an operation.
Users of this class should pass it to Operation's 'clone' methods. Current options include:
Definition at line 144 of file Operation.h.
| Operation::CloneOptions::CloneOptions | ( | ) |
Default constructs an option with all flags set to false.
That means all parts of an operation that may optionally not be cloned, are not cloned.
Definition at line 676 of file Operation.cpp.
References false.
Referenced by all().
| Operation::CloneOptions::CloneOptions | ( | bool | cloneRegions, |
| bool | cloneOperands, | ||
| std::optional< SmallVector< Type > > | resultTypes ) |
Constructs an instance with the options set accordingly.
Definition at line 680 of file Operation.cpp.
References cloneOperands(), and cloneRegions().
|
static |
Returns an instance such that all elements of the operation are cloned.
This is the default when using the clone method and clones all parts of the operation.
Definition at line 686 of file Operation.cpp.
References CloneOptions().
Referenced by mlir::Region::cloneInto(), and mlir::Operation::cloneWithoutRegions().
| Operation::CloneOptions & Operation::CloneOptions::cloneOperands | ( | bool | enable = true | ) |
Configures whether operation' operands should be cloned.
Otherwise the resulting clones will simply have zero operands.
Definition at line 696 of file Operation.cpp.
Referenced by mlir::Region::cloneInto(), and CloneOptions().
| Operation::CloneOptions & Operation::CloneOptions::cloneRegions | ( | bool | enable = true | ) |
Configures whether cloning should traverse into any of the regions of the operation.
If set to true, the operation's regions are recursively cloned. If set to false, cloned operations will have the same number of regions, but they will be empty. Cloning of nested operations in the operation's regions are currently unaffected by other flags.
Definition at line 691 of file Operation.cpp.
Referenced by mlir::Region::cloneInto(), and CloneOptions().
Returns the result types that should be used for the created operation or defaultResultTypes if none were set.
Definition at line 187 of file Operation.h.
|
inline |
Returns whether operands should be cloned as well.
Definition at line 175 of file Operation.h.
|
inline |
Returns whether regions of the operation should be cloned as well.
Definition at line 168 of file Operation.h.
|
inline |
Returns true if the results are cloned from the operation.
Definition at line 183 of file Operation.h.
| Operation::CloneOptions & Operation::CloneOptions::withResultTypes | ( | std::optional< SmallVector< Type > > | resultTypes | ) |
Configures different result types to use for the cloned operation.
If an empty optional, the result types are cloned from the original operation.
Definition at line 701 of file Operation.cpp.