39 return unwrap(affineExpr).isSymbolicOrConstant();
43 return unwrap(affineExpr).isPureAffine();
47 return unwrap(affineExpr).getLargestKnownDivisor();
51 return unwrap(affineExpr).isMultipleOf(factor);
56 return unwrap(affineExpr).isFunctionOfDim(position);
60 MlirAffineMap affineMap) {
65 uint32_t numDims, uint32_t shift,
67 return wrap(
unwrap(affineExpr).shiftDims(numDims, shift, offset));
71 uint32_t numSymbols, uint32_t shift,
73 return wrap(
unwrap(affineExpr).shiftSymbols(numSymbols, shift, offset));
77 uint32_t numSymbols) {
86 return isa<AffineDimExpr>(
unwrap(affineExpr));
94 return cast<AffineDimExpr>(
unwrap(affineExpr)).getPosition();
102 return isa<AffineSymbolExpr>(
unwrap(affineExpr));
110 return cast<AffineSymbolExpr>(
unwrap(affineExpr)).getPosition();
118 return isa<AffineConstantExpr>(
unwrap(affineExpr));
126 return cast<AffineConstantExpr>(
unwrap(affineExpr)).getValue();
177 MlirAffineExpr rhs) {
191 MlirAffineExpr rhs) {
201 return isa<AffineBinaryOpExpr>(
unwrap(affineExpr));
205 return wrap(cast<AffineBinaryOpExpr>(
unwrap(affineExpr)).getLHS());
209 return wrap(cast<AffineBinaryOpExpr>(
unwrap(affineExpr)).getRHS());
MlirAffineExpr mlirAffineExprCompose(MlirAffineExpr affineExpr, MlirAffineMap affineMap)
Composes the given map with the given expression.
bool mlirAffineExprIsSymbolicOrConstant(MlirAffineExpr affineExpr)
Checks whether the given affine expression is made out of only symbols and constants.
void mlirAffineExprDump(MlirAffineExpr affineExpr)
Prints the affine expression to the standard error stream.
int64_t mlirAffineExprGetLargestKnownDivisor(MlirAffineExpr affineExpr)
Returns the greatest known integral divisor of this affine expression.
MlirAffineExpr mlirAffineCeilDivExprGet(MlirAffineExpr lhs, MlirAffineExpr rhs)
Creates an affine ceildiv expression with 'lhs' and 'rhs'.
bool mlirAffineExprIsFunctionOfDim(MlirAffineExpr affineExpr, intptr_t position)
Checks whether the given affine expression involves AffineDimExpr 'position'.
MlirAffineExpr mlirAffineFloorDivExprGet(MlirAffineExpr lhs, MlirAffineExpr rhs)
Creates an affine floordiv expression with 'lhs' and 'rhs'.
bool mlirAffineExprIsABinary(MlirAffineExpr affineExpr)
Checks whether the given affine expression is binary.
MlirAffineExpr mlirSimplifyAffineExpr(MlirAffineExpr expr, uint32_t numDims, uint32_t numSymbols)
Simplify an affine expression by flattening and some amount of simple analysis.
bool mlirAffineExprIsACeilDiv(MlirAffineExpr affineExpr)
Checks whether the given affine expression is an ceildiv expression.
bool mlirAffineExprIsAConstant(MlirAffineExpr affineExpr)
Checks whether the given affine expression is a constant expression.
MlirAffineExpr mlirAffineExprShiftDims(MlirAffineExpr affineExpr, uint32_t numDims, uint32_t shift, uint32_t offset)
Replace dims[offset ...
void mlirAffineExprPrint(MlirAffineExpr affineExpr, MlirStringCallback callback, void *userData)
Prints an affine expression by sending chunks of the string representation and forwarding userData to...
bool mlirAffineExprIsADim(MlirAffineExpr affineExpr)
Checks whether the given affine expression is a dimension expression.
bool mlirAffineExprIsAAdd(MlirAffineExpr affineExpr)
Checks whether the given affine expression is an add expression.
intptr_t mlirAffineDimExprGetPosition(MlirAffineExpr affineExpr)
Returns the position of the given affine dimension expression.
MlirAffineExpr mlirAffineBinaryOpExprGetLHS(MlirAffineExpr affineExpr)
Returns the left hand side affine expression of the given affine binary operation expression.
bool mlirAffineExprEqual(MlirAffineExpr lhs, MlirAffineExpr rhs)
Returns true if the two affine expressions are equal.
MlirAffineExpr mlirAffineAddExprGet(MlirAffineExpr lhs, MlirAffineExpr rhs)
Creates an affine add expression with 'lhs' and 'rhs'.
bool mlirAffineExprIsAFloorDiv(MlirAffineExpr affineExpr)
Checks whether the given affine expression is an floordiv expression.
MlirAffineExpr mlirAffineMulExprGet(MlirAffineExpr lhs, MlirAffineExpr rhs)
Creates an affine mul expression with 'lhs' and 'rhs'.
MlirAffineExpr mlirAffineBinaryOpExprGetRHS(MlirAffineExpr affineExpr)
Returns the right hand side affine expression of the given affine binary operation expression.
MlirAffineExpr mlirAffineSymbolExprGet(MlirContext ctx, intptr_t position)
Creates an affine symbol expression with 'position' in the context.
bool mlirAffineExprIsAMul(MlirAffineExpr affineExpr)
Checks whether the given affine expression is an mul expression.
intptr_t mlirAffineSymbolExprGetPosition(MlirAffineExpr affineExpr)
Returns the position of the given affine symbol expression.
MlirAffineExpr mlirAffineConstantExprGet(MlirContext ctx, int64_t constant)
Creates an affine constant expression with 'constant' in the context.
bool mlirAffineExprIsAMod(MlirAffineExpr affineExpr)
Checks whether the given affine expression is an mod expression.
bool mlirAffineExprIsASymbol(MlirAffineExpr affineExpr)
Checks whether the given affine expression is a symbol expression.
bool mlirAffineExprIsPureAffine(MlirAffineExpr affineExpr)
Checks whether the given affine expression is a pure affine expression, i.e.
MlirAffineExpr mlirAffineModExprGet(MlirAffineExpr lhs, MlirAffineExpr rhs)
Creates an affine mod expression with 'lhs' and 'rhs'.
MlirContext mlirAffineExprGetContext(MlirAffineExpr affineExpr)
Gets the context that owns the affine expression.
MlirAffineExpr mlirAffineDimExprGet(MlirContext ctx, intptr_t position)
Creates an affine dimension expression with 'position' in the context.
bool mlirAffineExprIsMultipleOf(MlirAffineExpr affineExpr, int64_t factor)
Checks whether the given affine expression is a multiple of 'factor'.
int64_t mlirAffineConstantExprGetValue(MlirAffineExpr affineExpr)
Returns the value of the given affine constant expression.
MlirAffineExpr mlirAffineExprShiftSymbols(MlirAffineExpr affineExpr, uint32_t numSymbols, uint32_t shift, uint32_t offset)
Replace symbols[offset ...
static MLIRContext * getContext(OpFoldResult val)
void print(raw_ostream &os) const
Outputs this diagnostic to a stream.
A simple raw ostream subclass that forwards write_impl calls to the user-supplied callback together w...
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
MlirDiagnostic wrap(mlir::Diagnostic &diagnostic)
void(* MlirStringCallback)(MlirStringRef, void *)
A callback for returning string references.
Include the generated interface declarations.
@ CeilDiv
RHS of ceildiv is always a constant or a symbolic expression.
@ Mul
RHS of mul is always a constant or a symbolic expression.
@ Mod
RHS of mod is always a constant or a symbolic expression with a positive value.
@ FloorDiv
RHS of floordiv is always a constant or a symbolic expression.
AffineExpr getAffineBinaryOpExpr(AffineExprKind kind, AffineExpr lhs, AffineExpr rhs)
AffineExpr getAffineConstantExpr(int64_t constant, MLIRContext *context)
AffineExpr simplifyAffineExpr(AffineExpr expr, unsigned numDims, unsigned numSymbols)
Simplify an affine expression by flattening and some amount of simple analysis.
AffineExpr getAffineDimExpr(unsigned position, MLIRContext *context)
These free functions allow clients of the API to not use classes in detail.
AffineExpr getAffineSymbolExpr(unsigned position, MLIRContext *context)