MLIR
21.0.0git
|
#include "mlir-c/AffineExpr.h"
#include "mlir-c/AffineMap.h"
#include "mlir-c/IR.h"
#include "mlir/CAPI/AffineExpr.h"
#include "mlir/CAPI/AffineMap.h"
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Utils.h"
#include "mlir/IR/AffineExpr.h"
Go to the source code of this file.
Functions | |
MlirContext | mlirAffineExprGetContext (MlirAffineExpr affineExpr) |
Gets the context that owns the affine expression. More... | |
bool | mlirAffineExprEqual (MlirAffineExpr lhs, MlirAffineExpr rhs) |
Returns true if the two affine expressions are equal. More... | |
void | mlirAffineExprPrint (MlirAffineExpr affineExpr, MlirStringCallback callback, void *userData) |
Prints an affine expression by sending chunks of the string representation and forwarding userData to callback`. More... | |
void | mlirAffineExprDump (MlirAffineExpr affineExpr) |
Prints the affine expression to the standard error stream. More... | |
bool | mlirAffineExprIsSymbolicOrConstant (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is made out of only symbols and constants. More... | |
bool | mlirAffineExprIsPureAffine (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is a pure affine expression, i.e. More... | |
int64_t | mlirAffineExprGetLargestKnownDivisor (MlirAffineExpr affineExpr) |
Returns the greatest known integral divisor of this affine expression. More... | |
bool | mlirAffineExprIsMultipleOf (MlirAffineExpr affineExpr, int64_t factor) |
Checks whether the given affine expression is a multiple of 'factor'. More... | |
bool | mlirAffineExprIsFunctionOfDim (MlirAffineExpr affineExpr, intptr_t position) |
Checks whether the given affine expression involves AffineDimExpr 'position'. More... | |
MlirAffineExpr | mlirAffineExprCompose (MlirAffineExpr affineExpr, MlirAffineMap affineMap) |
Composes the given map with the given expression. More... | |
MlirAffineExpr | mlirAffineExprShiftDims (MlirAffineExpr affineExpr, uint32_t numDims, uint32_t shift, uint32_t offset) |
Replace dims[offset ... More... | |
MlirAffineExpr | mlirAffineExprShiftSymbols (MlirAffineExpr affineExpr, uint32_t numSymbols, uint32_t shift, uint32_t offset) |
Replace symbols[offset ... More... | |
MlirAffineExpr | mlirSimplifyAffineExpr (MlirAffineExpr expr, uint32_t numDims, uint32_t numSymbols) |
Simplify an affine expression by flattening and some amount of simple analysis. More... | |
bool | mlirAffineExprIsADim (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is a dimension expression. More... | |
MlirAffineExpr | mlirAffineDimExprGet (MlirContext ctx, intptr_t position) |
Creates an affine dimension expression with 'position' in the context. More... | |
intptr_t | mlirAffineDimExprGetPosition (MlirAffineExpr affineExpr) |
Returns the position of the given affine dimension expression. More... | |
bool | mlirAffineExprIsASymbol (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is a symbol expression. More... | |
MlirAffineExpr | mlirAffineSymbolExprGet (MlirContext ctx, intptr_t position) |
Creates an affine symbol expression with 'position' in the context. More... | |
intptr_t | mlirAffineSymbolExprGetPosition (MlirAffineExpr affineExpr) |
Returns the position of the given affine symbol expression. More... | |
bool | mlirAffineExprIsAConstant (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is a constant expression. More... | |
MlirAffineExpr | mlirAffineConstantExprGet (MlirContext ctx, int64_t constant) |
Creates an affine constant expression with 'constant' in the context. More... | |
int64_t | mlirAffineConstantExprGetValue (MlirAffineExpr affineExpr) |
Returns the value of the given affine constant expression. More... | |
bool | mlirAffineExprIsAAdd (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is an add expression. More... | |
MlirAffineExpr | mlirAffineAddExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs) |
Creates an affine add expression with 'lhs' and 'rhs'. More... | |
bool | mlirAffineExprIsAMul (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is an mul expression. More... | |
MlirAffineExpr | mlirAffineMulExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs) |
Creates an affine mul expression with 'lhs' and 'rhs'. More... | |
bool | mlirAffineExprIsAMod (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is an mod expression. More... | |
MlirAffineExpr | mlirAffineModExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs) |
Creates an affine mod expression with 'lhs' and 'rhs'. More... | |
bool | mlirAffineExprIsAFloorDiv (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is an floordiv expression. More... | |
MlirAffineExpr | mlirAffineFloorDivExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs) |
Creates an affine floordiv expression with 'lhs' and 'rhs'. More... | |
bool | mlirAffineExprIsACeilDiv (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is an ceildiv expression. More... | |
MlirAffineExpr | mlirAffineCeilDivExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs) |
Creates an affine ceildiv expression with 'lhs' and 'rhs'. More... | |
bool | mlirAffineExprIsABinary (MlirAffineExpr affineExpr) |
Checks whether the given affine expression is binary. More... | |
MlirAffineExpr | mlirAffineBinaryOpExprGetLHS (MlirAffineExpr affineExpr) |
Returns the left hand side affine expression of the given affine binary operation expression. More... | |
MlirAffineExpr | mlirAffineBinaryOpExprGetRHS (MlirAffineExpr affineExpr) |
Returns the right hand side affine expression of the given affine binary operation expression. More... | |
MlirAffineExpr mlirAffineAddExprGet | ( | MlirAffineExpr | lhs, |
MlirAffineExpr | rhs | ||
) |
Creates an affine add expression with 'lhs' and 'rhs'.
Definition at line 137 of file AffineExpr.cpp.
References mlir::Add, mlir::getAffineBinaryOpExpr(), unwrap(), and wrap().
MlirAffineExpr mlirAffineBinaryOpExprGetLHS | ( | MlirAffineExpr | affineExpr | ) |
Returns the left hand side affine expression of the given affine binary operation expression.
Definition at line 204 of file AffineExpr.cpp.
MlirAffineExpr mlirAffineBinaryOpExprGetRHS | ( | MlirAffineExpr | affineExpr | ) |
Returns the right hand side affine expression of the given affine binary operation expression.
Definition at line 208 of file AffineExpr.cpp.
MlirAffineExpr mlirAffineCeilDivExprGet | ( | MlirAffineExpr | lhs, |
MlirAffineExpr | rhs | ||
) |
Creates an affine ceildiv expression with 'lhs' and 'rhs'.
Definition at line 190 of file AffineExpr.cpp.
References mlir::CeilDiv, mlir::getAffineBinaryOpExpr(), unwrap(), and wrap().
MlirAffineExpr mlirAffineConstantExprGet | ( | MlirContext | ctx, |
int64_t | constant | ||
) |
Creates an affine constant expression with 'constant' in the context.
Definition at line 121 of file AffineExpr.cpp.
References mlir::getAffineConstantExpr(), unwrap(), and wrap().
int64_t mlirAffineConstantExprGetValue | ( | MlirAffineExpr | affineExpr | ) |
Returns the value of the given affine constant expression.
Definition at line 125 of file AffineExpr.cpp.
References unwrap().
MlirAffineExpr mlirAffineDimExprGet | ( | MlirContext | ctx, |
intptr_t | position | ||
) |
Creates an affine dimension expression with 'position' in the context.
Definition at line 89 of file AffineExpr.cpp.
References mlir::getAffineDimExpr(), unwrap(), and wrap().
intptr_t mlirAffineDimExprGetPosition | ( | MlirAffineExpr | affineExpr | ) |
Returns the position of the given affine dimension expression.
Definition at line 93 of file AffineExpr.cpp.
References unwrap().
MlirAffineExpr mlirAffineExprCompose | ( | MlirAffineExpr | affineExpr, |
MlirAffineMap | affineMap | ||
) |
Composes the given map with the given expression.
Definition at line 59 of file AffineExpr.cpp.
void mlirAffineExprDump | ( | MlirAffineExpr | affineExpr | ) |
Prints the affine expression to the standard error stream.
Definition at line 34 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprEqual | ( | MlirAffineExpr | lhs, |
MlirAffineExpr | rhs | ||
) |
Returns true
if the two affine expressions are equal.
Definition at line 24 of file AffineExpr.cpp.
References unwrap().
Referenced by mlir::python::PyAffineExpr::operator==().
MlirContext mlirAffineExprGetContext | ( | MlirAffineExpr | affineExpr | ) |
Gets the context that owns the affine expression.
Definition at line 20 of file AffineExpr.cpp.
References getContext(), unwrap(), and wrap().
Referenced by mlir::python::PyAffineExpr::createFromCapsule().
int64_t mlirAffineExprGetLargestKnownDivisor | ( | MlirAffineExpr | affineExpr | ) |
Returns the greatest known integral divisor of this affine expression.
The result is always positive.
Definition at line 46 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsAAdd | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is an add expression.
Definition at line 133 of file AffineExpr.cpp.
bool mlirAffineExprIsABinary | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is binary.
Definition at line 200 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsACeilDiv | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is an ceildiv expression.
Definition at line 186 of file AffineExpr.cpp.
References mlir::CeilDiv, and unwrap().
bool mlirAffineExprIsAConstant | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is a constant expression.
Definition at line 117 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsADim | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is a dimension expression.
Definition at line 85 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsAFloorDiv | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is an floordiv expression.
Definition at line 172 of file AffineExpr.cpp.
References mlir::FloorDiv, and unwrap().
bool mlirAffineExprIsAMod | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is an mod expression.
Definition at line 159 of file AffineExpr.cpp.
bool mlirAffineExprIsAMul | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is an mul expression.
Definition at line 146 of file AffineExpr.cpp.
bool mlirAffineExprIsASymbol | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is a symbol expression.
Definition at line 101 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsFunctionOfDim | ( | MlirAffineExpr | affineExpr, |
intptr_t | position | ||
) |
Checks whether the given affine expression involves AffineDimExpr 'position'.
Definition at line 54 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsMultipleOf | ( | MlirAffineExpr | affineExpr, |
int64_t | factor | ||
) |
Checks whether the given affine expression is a multiple of 'factor'.
Definition at line 50 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsPureAffine | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is a pure affine expression, i.e.
mul, floordiv, ceildic, and mod is only allowed w.r.t constants.
Definition at line 42 of file AffineExpr.cpp.
References unwrap().
bool mlirAffineExprIsSymbolicOrConstant | ( | MlirAffineExpr | affineExpr | ) |
Checks whether the given affine expression is made out of only symbols and constants.
Definition at line 38 of file AffineExpr.cpp.
References unwrap().
void mlirAffineExprPrint | ( | MlirAffineExpr | affineExpr, |
MlirStringCallback | callback, | ||
void * | userData | ||
) |
Prints an affine expression by sending chunks of the string representation and forwarding userData to
callback`.
Note that the callback may be called several times with consecutive chunks of the string.
Definition at line 28 of file AffineExpr.cpp.
References mlir::Diagnostic::print(), and unwrap().
MlirAffineExpr mlirAffineExprShiftDims | ( | MlirAffineExpr | affineExpr, |
uint32_t | numDims, | ||
uint32_t | shift, | ||
uint32_t | offset | ||
) |
Replace dims[offset ...
numDims) by dims[offset + shift ... shift + numDims).
Definition at line 64 of file AffineExpr.cpp.
MlirAffineExpr mlirAffineExprShiftSymbols | ( | MlirAffineExpr | affineExpr, |
uint32_t | numSymbols, | ||
uint32_t | shift, | ||
uint32_t | offset | ||
) |
Replace symbols[offset ...
numSymbols) by symbols[offset + shift ... shift + numSymbols).
Definition at line 70 of file AffineExpr.cpp.
MlirAffineExpr mlirAffineFloorDivExprGet | ( | MlirAffineExpr | lhs, |
MlirAffineExpr | rhs | ||
) |
Creates an affine floordiv expression with 'lhs' and 'rhs'.
Definition at line 176 of file AffineExpr.cpp.
References mlir::FloorDiv, mlir::getAffineBinaryOpExpr(), unwrap(), and wrap().
MlirAffineExpr mlirAffineModExprGet | ( | MlirAffineExpr | lhs, |
MlirAffineExpr | rhs | ||
) |
Creates an affine mod expression with 'lhs' and 'rhs'.
Definition at line 163 of file AffineExpr.cpp.
References mlir::getAffineBinaryOpExpr(), mlir::Mod, unwrap(), and wrap().
MlirAffineExpr mlirAffineMulExprGet | ( | MlirAffineExpr | lhs, |
MlirAffineExpr | rhs | ||
) |
Creates an affine mul expression with 'lhs' and 'rhs'.
Definition at line 150 of file AffineExpr.cpp.
References mlir::getAffineBinaryOpExpr(), mlir::Mul, unwrap(), and wrap().
MlirAffineExpr mlirAffineSymbolExprGet | ( | MlirContext | ctx, |
intptr_t | position | ||
) |
Creates an affine symbol expression with 'position' in the context.
Definition at line 105 of file AffineExpr.cpp.
References mlir::getAffineSymbolExpr(), unwrap(), and wrap().
intptr_t mlirAffineSymbolExprGetPosition | ( | MlirAffineExpr | affineExpr | ) |
Returns the position of the given affine symbol expression.
Definition at line 109 of file AffineExpr.cpp.
References unwrap().
MlirAffineExpr mlirSimplifyAffineExpr | ( | MlirAffineExpr | expr, |
uint32_t | numDims, | ||
uint32_t | numSymbols | ||
) |
Simplify an affine expression by flattening and some amount of simple analysis.
This has complexity linear in the number of nodes in 'expr'. Returns the simplified expression, which is the same as the input expression if it can't be simplified. When expr
is semi-affine, a simplified semi-affine expression is constructed in the sorted order of dimension and symbol positions.
Definition at line 76 of file AffineExpr.cpp.
References mlir::simplifyAffineExpr(), unwrap(), and wrap().