MLIR
20.0.0git
|
This pass class wraps external passes defined in other languages using the MLIR C-interface. More...
Public Member Functions | |
ExternalPass (TypeID passID, StringRef name, StringRef argument, StringRef description, std::optional< StringRef > opName, ArrayRef< MlirDialectHandle > dependentDialects, MlirExternalPassCallbacks callbacks, void *userData) | |
~ExternalPass () override | |
StringRef | getName () const override |
Returns the derived pass name. More... | |
StringRef | getArgument () const override |
Return the command line argument used when registering this pass. More... | |
StringRef | getDescription () const override |
Return the command line description used when registering this pass. More... | |
void | getDependentDialects (DialectRegistry ®istry) const override |
Register dependent dialects for the current pass. More... | |
void | signalPassFailure () |
Public Member Functions inherited from mlir::Pass | |
virtual | ~Pass ()=default |
TypeID | getTypeID () const |
Returns the unique identifier that corresponds to this pass. More... | |
const PassInfo * | lookupPassInfo () const |
Returns the pass info for this pass, or null if unknown. More... | |
std::optional< StringRef > | getOpName () const |
Returns the name of the operation that this pass operates on, or std::nullopt if this is a generic OperationPass. More... | |
virtual LogicalResult | initializeOptions (StringRef options, function_ref< LogicalResult(const Twine &)> errorHandler) |
Attempt to initialize the options of this pass from the given string. More... | |
void | printAsTextualPipeline (raw_ostream &os) |
Prints out the pass in the textual representation of pipelines. More... | |
ArrayRef< Statistic * > | getStatistics () const |
Returns the main statistics for this pass instance. More... | |
MutableArrayRef< Statistic * > | getStatistics () |
const Pass * | getThreadingSibling () const |
Returns the thread sibling of this pass. More... | |
const Pass * | getThreadingSiblingOrThis () const |
Returns the thread sibling of this pass, or the pass itself it has no sibling. More... | |
Protected Member Functions | |
LogicalResult | initialize (MLIRContext *ctx) override |
Initialize any complex state necessary for running this pass. More... | |
bool | canScheduleOn (RegisteredOperationName opName) const override |
Indicate if the current pass can be scheduled on the given operation type. More... | |
void | runOnOperation () override |
The polymorphic API that runs the pass over the currently held operation. More... | |
std::unique_ptr< Pass > | clonePass () const override |
Create a copy of this pass, ignoring statistics and options. More... | |
Protected Member Functions inherited from mlir::Pass | |
Pass (TypeID passID, std::optional< StringRef > opName=std::nullopt) | |
Pass (const Pass &other) | |
Pass & | operator= (const Pass &)=delete |
Pass (Pass &&)=delete | |
Pass & | operator= (Pass &&)=delete |
detail::PassExecutionState & | getPassState () |
Returns the current pass state. More... | |
MLIRContext & | getContext () |
Return the MLIR context for the current operation being transformed. More... | |
LogicalResult | runPipeline (OpPassManager &pipeline, Operation *op) |
Schedule an arbitrary pass pipeline on the provided operation. More... | |
std::unique_ptr< Pass > | clone () const |
A clone method to create a copy of this pass. More... | |
Operation * | getOperation () |
Return the current operation being transformed. More... | |
void | signalPassFailure () |
Signal that some invariant was broken when running. More... | |
template<typename AnalysisT > | |
AnalysisT & | getAnalysis () |
Query an analysis for the current ir unit. More... | |
template<typename AnalysisT , typename OpT > | |
AnalysisT & | getAnalysis () |
Query an analysis for the current ir unit of a specific derived operation type. More... | |
template<typename AnalysisT > | |
std::optional< std::reference_wrapper< AnalysisT > > | getCachedAnalysis () |
Query a cached instance of an analysis for the current ir unit if one exists. More... | |
void | markAllAnalysesPreserved () |
Mark all analyses as preserved. More... | |
template<typename... AnalysesT> | |
void | markAnalysesPreserved () |
Mark the provided analyses as preserved. More... | |
void | markAnalysesPreserved (TypeID id) |
template<typename AnalysisT > | |
std::optional< std::reference_wrapper< AnalysisT > > | getCachedParentAnalysis (Operation *parent) |
Returns the analysis for the given parent operation if it exists. More... | |
template<typename AnalysisT > | |
std::optional< std::reference_wrapper< AnalysisT > > | getCachedParentAnalysis () |
Returns the analysis for the parent operation if it exists. More... | |
template<typename AnalysisT > | |
std::optional< std::reference_wrapper< AnalysisT > > | getCachedChildAnalysis (Operation *child) |
Returns the analysis for the given child operation if it exists. More... | |
template<typename AnalysisT > | |
AnalysisT & | getChildAnalysis (Operation *child) |
Returns the analysis for the given child operation, or creates it if it doesn't exist. More... | |
template<typename AnalysisT , typename OpTy > | |
AnalysisT & | getChildAnalysis (OpTy child) |
Returns the analysis for the given child operation of specific derived operation type, or creates it if it doesn't exist. More... | |
AnalysisManager | getAnalysisManager () |
Returns the current analysis manager. More... | |
void | copyOptionValuesFrom (const Pass *other) |
Copy the option values from 'other', which is another instance of this pass. More... | |
This pass class wraps external passes defined in other languages using the MLIR C-interface.
|
inline |
Definition at line 135 of file Pass.cpp.
References MlirExternalPassCallbacks::construct.
|
inlineoverride |
Definition at line 145 of file Pass.cpp.
References MlirExternalPassCallbacks::destruct.
|
inlineoverrideprotectedvirtual |
Indicate if the current pass can be scheduled on the given operation type.
This is useful for generic operation passes to add restrictions on the operations they operate on.
Implements mlir::Pass.
Definition at line 166 of file Pass.cpp.
References mlir::Pass::getOpName(), and mlir::OperationName::getStringRef().
|
inlineoverrideprotectedvirtual |
Create a copy of this pass, ignoring statistics and options.
Implements mlir::Pass.
Definition at line 176 of file Pass.cpp.
References MlirExternalPassCallbacks::clone, and mlir::Pass::getOpName().
|
inlineoverridevirtual |
Return the command line argument used when registering this pass.
Return an empty string if one does not exist.
Reimplemented from mlir::Pass.
|
inlineoverridevirtual |
Register dependent dialects for the current pass.
A pass is expected to register the dialects it will create entities for (Operations, Types, Attributes), other than dialect that exists in the input. For example, a pass that converts from Linalg to Affine would register the Affine dialect but does not need to register Linalg.
Reimplemented from mlir::Pass.
Definition at line 151 of file Pass.cpp.
References mlirDialectHandleInsertDialect(), and wrap().
|
inlineoverridevirtual |
Return the command line description used when registering this pass.
Return an empty string if one does not exist.
Reimplemented from mlir::Pass.
|
inlineoverridevirtual |
|
inlineoverrideprotectedvirtual |
Initialize any complex state necessary for running this pass.
This hook should not rely on any state accessible during the execution of a pass. For example, getContext
/getOperation
/getAnalysis
/etc. should not be invoked within this hook. This method is invoked after all dependent dialects for the pipeline are loaded, and is not allowed to load any further dialects (override the getDependentDialects()
for this purpose instead). Returns a LogicalResult to indicate failure, in which case the pass pipeline won't execute.
Reimplemented from mlir::Pass.
Definition at line 160 of file Pass.cpp.
References MlirExternalPassCallbacks::initialize, unwrap(), and wrap().
|
inlineoverrideprotectedvirtual |
The polymorphic API that runs the pass over the currently held operation.
Implements mlir::Pass.
Definition at line 172 of file Pass.cpp.
References mlir::Pass::getOperation(), MlirExternalPassCallbacks::run, and wrap().
|
inline |
Definition at line 157 of file Pass.cpp.
References mlir::Pass::signalPassFailure().