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) {
69 return isa<AffineDimExpr>(
unwrap(affineExpr));
77 return cast<AffineDimExpr>(
unwrap(affineExpr)).getPosition();
85 return isa<AffineSymbolExpr>(
unwrap(affineExpr));
93 return cast<AffineSymbolExpr>(
unwrap(affineExpr)).getPosition();
101 return isa<AffineConstantExpr>(
unwrap(affineExpr));
109 return cast<AffineConstantExpr>(
unwrap(affineExpr)).getValue();
160 MlirAffineExpr rhs) {
174 MlirAffineExpr rhs) {
184 return isa<AffineBinaryOpExpr>(
unwrap(affineExpr));
188 return wrap(cast<AffineBinaryOpExpr>(
unwrap(affineExpr)).getLHS());
192 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.
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.
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.
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 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)