MLIR  17.0.0git
Public Member Functions | List of all members
mlir::InlinerInterface Class Reference

This interface provides the hooks into the inlining interface. More...

#include "mlir/Transforms/InliningUtils.h"

+ Inheritance diagram for mlir::InlinerInterface:
+ Collaboration diagram for mlir::InlinerInterface:

Public Member Functions

virtual void processInlinedBlocks (iterator_range< Region::iterator > inlinedBlocks)
 Process a set of blocks that have been inlined. More...
 
virtual bool isLegalToInline (Operation *call, Operation *callable, bool wouldBeCloned) const
 These hooks mirror the hooks for the DialectInlinerInterface, with default implementations that call the hook on the handler for the dialect 'op' is registered to. More...
 
virtual bool isLegalToInline (Region *dest, Region *src, bool wouldBeCloned, IRMapping &valueMapping) const
 
virtual bool isLegalToInline (Operation *op, Region *dest, bool wouldBeCloned, IRMapping &valueMapping) const
 
virtual bool shouldAnalyzeRecursively (Operation *op) const
 
virtual void handleTerminator (Operation *op, Block *newDest) const
 Handle the given inlined terminator by replacing it with a new operation as necessary. More...
 
virtual void handleTerminator (Operation *op, ArrayRef< Value > valuesToRepl) const
 Handle the given inlined terminator by replacing it with a new operation as necessary. More...
 
virtual void processInlinedCallBlocks (Operation *call, iterator_range< Region::iterator > inlinedBlocks) const
 
- Public Member Functions inherited from mlir::DialectInterfaceCollection< DialectInlinerInterface >
 DialectInterfaceCollection (MLIRContext *ctx)
 Collect the registered dialect interfaces within the provided context. More...
 
const DialectInlinerInterfacegetInterfaceFor (Object *obj) const
 Get the interface for a given object, or null if one is not registered. More...
 
iterator begin () const
 
iterator end () const
 
- Public Member Functions inherited from mlir::detail::DialectInterfaceCollectionBase
 DialectInterfaceCollectionBase (MLIRContext *ctx, TypeID interfaceKind)
 
virtual ~DialectInterfaceCollectionBase ()
 

Additional Inherited Members

- Public Types inherited from mlir::DialectInterfaceCollection< DialectInlinerInterface >
using Base = DialectInterfaceCollection< DialectInlinerInterface >
 
using iterator = detail::DialectInterfaceCollectionBase::iterator< DialectInlinerInterface >
 Iterator access to the held interfaces. More...
 
- Protected Member Functions inherited from mlir::detail::DialectInterfaceCollectionBase
const DialectInterfacegetInterfaceFor (Operation *op) const
 Get the interface for the dialect of given operation, or null if one is not registered. More...
 
const DialectInterfacegetInterfaceFor (Dialect *dialect) const
 Get the interface for the given dialect. More...
 
template<typename InterfaceT >
iterator< InterfaceT > interface_begin () const
 Iterator access to the held interfaces. More...
 
template<typename InterfaceT >
iterator< InterfaceT > interface_end () const
 

Detailed Description

This interface provides the hooks into the inlining interface.

Note: this class automatically collects 'DialectInlinerInterface' objects registered to each dialect within the given context.

Definition at line 153 of file InliningUtils.h.

Member Function Documentation

◆ handleTerminator() [1/2]

void InlinerInterface::handleTerminator ( Operation op,
ArrayRef< Value valuesToRepl 
) const
virtual

Handle the given inlined terminator by replacing it with a new operation as necessary.

Definition at line 99 of file InliningUtils.cpp.

References mlir::DialectInterfaceCollection< DialectInlinerInterface >::getInterfaceFor().

◆ handleTerminator() [2/2]

void InlinerInterface::handleTerminator ( Operation op,
Block newDest 
) const
virtual

Handle the given inlined terminator by replacing it with a new operation as necessary.

Definition at line 91 of file InliningUtils.cpp.

References mlir::DialectInterfaceCollection< DialectInlinerInterface >::getInterfaceFor().

Referenced by inlineRegionImpl().

◆ isLegalToInline() [1/3]

bool InlinerInterface::isLegalToInline ( Operation call,
Operation callable,
bool  wouldBeCloned 
) const
virtual

These hooks mirror the hooks for the DialectInlinerInterface, with default implementations that call the hook on the handler for the dialect 'op' is registered to.

Definition at line 61 of file InliningUtils.cpp.

References mlir::DialectInterfaceCollection< DialectInlinerInterface >::getInterfaceFor().

Referenced by mlir::inlineCall(), inlineRegionImpl(), and isLegalToInline().

◆ isLegalToInline() [2/3]

bool InlinerInterface::isLegalToInline ( Operation op,
Region dest,
bool  wouldBeCloned,
IRMapping valueMapping 
) const
virtual

◆ isLegalToInline() [3/3]

bool InlinerInterface::isLegalToInline ( Region dest,
Region src,
bool  wouldBeCloned,
IRMapping valueMapping 
) const
virtual

◆ processInlinedBlocks()

virtual void mlir::InlinerInterface::processInlinedBlocks ( iterator_range< Region::iterator inlinedBlocks)
inlinevirtual

Process a set of blocks that have been inlined.

This callback is invoked before inlined terminator operations have been processed.

Definition at line 161 of file InliningUtils.h.

Referenced by inlineRegionImpl().

◆ processInlinedCallBlocks()

void InlinerInterface::processInlinedCallBlocks ( Operation call,
iterator_range< Region::iterator inlinedBlocks 
) const
virtual

◆ shouldAnalyzeRecursively()

bool InlinerInterface::shouldAnalyzeRecursively ( Operation op) const
virtual

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