MLIR 22.0.0git
mlir::Operation::CloneOptions Class Reference

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)
 Constructs an instance with the clone regions and clone operands flags set accordingly.
CloneOptionscloneRegions (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.
CloneOptionscloneOperands (bool enable=true)
 Configures whether operation' operands should be cloned.
bool shouldCloneOperands () const
 Returns whether operands should be cloned as well.

Static Public Member Functions

static CloneOptions all ()
 Returns an instance with all flags set to true.

Detailed Description

Class encompassing various options related to cloning an operation.

Users of this class should pass it to Operation's 'clone' methods. Current options include:

  • Whether cloning should recursively traverse into the regions of the operation or not.
  • Whether cloning should also clone the operands of the operation.

Definition at line 143 of file Operation.h.

Constructor & Destructor Documentation

◆ CloneOptions() [1/2]

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().

◆ CloneOptions() [2/2]

Operation::CloneOptions::CloneOptions ( bool cloneRegions,
bool cloneOperands )

Constructs an instance with the clone regions and clone operands flags set accordingly.

Definition at line 679 of file Operation.cpp.

References cloneOperands(), and cloneRegions().

Member Function Documentation

◆ all()

Operation::CloneOptions Operation::CloneOptions::all ( )
static

Returns an instance with all flags set to true.

This is the default when using the clone method and clones all parts of the operation.

Definition at line 682 of file Operation.cpp.

References CloneOptions().

Referenced by mlir::Region::cloneInto(), and mlir::Operation::cloneWithoutRegions().

◆ cloneOperands()

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 691 of file Operation.cpp.

Referenced by mlir::Region::cloneInto(), and CloneOptions().

◆ cloneRegions()

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 686 of file Operation.cpp.

Referenced by mlir::Region::cloneInto(), and CloneOptions().

◆ shouldCloneOperands()

bool mlir::Operation::CloneOptions::shouldCloneOperands ( ) const
inline

Returns whether operands should be cloned as well.

Definition at line 173 of file Operation.h.

◆ shouldCloneRegions()

bool mlir::Operation::CloneOptions::shouldCloneRegions ( ) const
inline

Returns whether regions of the operation should be cloned as well.

Definition at line 166 of file Operation.h.


The documentation for this class was generated from the following files: