My Project
|
This class describes a specific conversion target. More...
#include <DialectConversion.h>
Classes | |
struct | LegalOpDetails |
Public Types | |
enum | LegalizationAction { LegalizationAction::Legal, LegalizationAction::Dynamic, LegalizationAction::Illegal } |
using | DynamicLegalityCallbackFn = std::function< bool(Operation *)> |
Public Member Functions | |
ConversionTarget (MLIRContext &ctx) | |
virtual | ~ConversionTarget ()=default |
void | setOpAction (OperationName op, LegalizationAction action) |
Register a legality action for the given operation. More... | |
template<typename OpT > | |
void | setOpAction (LegalizationAction action) |
template<typename OpT > | |
void | addLegalOp () |
Register the given operations as legal. More... | |
template<typename OpT , typename OpT2 , typename... OpTs> | |
void | addLegalOp () |
template<typename OpT > | |
void | addDynamicallyLegalOp () |
template<typename OpT , typename OpT2 , typename... OpTs> | |
void | addDynamicallyLegalOp () |
template<typename OpT > | |
void | addDynamicallyLegalOp (const DynamicLegalityCallbackFn &callback) |
template<typename OpT , typename OpT2 , typename... OpTs> | |
void | addDynamicallyLegalOp (const DynamicLegalityCallbackFn &callback) |
template<typename OpT , class Callable > | |
std::enable_if<!is_invocable< Callable, Operation * >::value >::type | addDynamicallyLegalOp (Callable &&callback) |
template<typename OpT > | |
void | addIllegalOp () |
template<typename OpT , typename OpT2 , typename... OpTs> | |
void | addIllegalOp () |
template<typename OpT > | |
void | markOpRecursivelyLegal (const DynamicLegalityCallbackFn &callback={}) |
template<typename OpT , typename OpT2 , typename... OpTs> | |
void | markOpRecursivelyLegal (const DynamicLegalityCallbackFn &callback={}) |
template<typename OpT , class Callable > | |
std::enable_if<!is_invocable< Callable, Operation * >::value >::type | markOpRecursivelyLegal (Callable &&callback) |
void | setDialectAction (ArrayRef< StringRef > dialectNames, LegalizationAction action) |
Register a legality action for the given dialects. More... | |
template<typename... Names> | |
void | addLegalDialect (StringRef name, Names... names) |
Register the operations of the given dialects as legal. More... | |
template<typename... Args> | |
void | addLegalDialect () |
template<typename... Names> | |
void | addDynamicallyLegalDialect (StringRef name, Names... names) |
template<typename... Args> | |
void | addDynamicallyLegalDialect (Optional< DynamicLegalityCallbackFn > callback=llvm::None) |
template<typename... Names> | |
void | addIllegalDialect (StringRef name, Names... names) |
template<typename... Args> | |
void | addIllegalDialect () |
Optional< LegalizationAction > | getOpAction (OperationName op) const |
Get the legality action for the given operation. More... | |
Optional< LegalOpDetails > | isLegal (Operation *op) const |
Protected Member Functions | |
virtual bool | isDynamicallyLegal (Operation *op) const |
This class describes a specific conversion target.
using mlir::ConversionTarget::DynamicLegalityCallbackFn = std::function<bool(Operation *)> |
The signature of the callback used to determine if an operation is dynamically legal on the target.
|
strong |
This enumeration corresponds to the specific action to take when considering an operation legal for this conversion target.
|
inline |
|
virtualdefault |
|
inline |
Register the operations of the given dialects as dynamically legal, i.e. requiring custom handling by the target via 'isDynamicallyLegal'.
|
inline |
|
inline |
Register the given operation as dynamically legal, i.e. requiring custom handling by the target via 'isDynamicallyLegal'.
|
inline |
|
inline |
Register the given operation as dynamically legal and set the dynamic legalization callback to the one provided.
|
inline |
|
inline |
|
inline |
Register the operations of the given dialects as illegal, i.e. operations of this dialect are not supported by the target.
|
inline |
|
inline |
Register the given operation as illegal, i.e. this operation is known to not be supported by this target.
|
inline |
|
inline |
Register the operations of the given dialects as legal.
|
inline |
|
inline |
Register the given operations as legal.
|
inline |
auto ConversionTarget::getOpAction | ( | OperationName | op | ) | const |
Get the legality action for the given operation.
|
inlineprotectedvirtual |
Runs a custom legalization query for the given operation. This should return true if the given operation is legal, otherwise false.
auto ConversionTarget::isLegal | ( | Operation * | op | ) | const |
If the given operation instance is legal on this target, a structure containing legality information is returned. If the operation is not legal, None is returned.
|
inline |
Mark an operation, that must have either been set as Legal
or DynamicallyLegal
, as being recursively legal. This means that in addition to the operation itself, all of the operations nested within are also considered legal. An optional dynamic legality callback may be provided to mark subsets of legal instances as recursively legal.
|
inline |
|
inline |
void ConversionTarget::setDialectAction | ( | ArrayRef< StringRef > | dialectNames, |
LegalizationAction | action | ||
) |
Register a legality action for the given dialects.
void ConversionTarget::setOpAction | ( | OperationName | op, |
LegalizationAction | action | ||
) |
Register a legality action for the given operation.
|
inline |