MLIR  16.0.0git
Macros | Functions
AffineExpr.h File Reference
#include "mlir-c/IR.h"
+ Include dependency graph for AffineExpr.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFINE_C_API_STRUCT(name, storage)
 

Functions

 DEFINE_C_API_STRUCT (MlirAffineExpr, const void)
 
MLIR_CAPI_EXPORTED MlirContext mlirAffineExprGetContext (MlirAffineExpr affineExpr)
 Gets the context that owns the affine expression. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprEqual (MlirAffineExpr lhs, MlirAffineExpr rhs)
 Returns true if the two affine expressions are equal. More...
 
static bool mlirAffineExprIsNull (MlirAffineExpr affineExpr)
 Returns true if the given affine expression is a null expression. More...
 
MLIR_CAPI_EXPORTED void mlirAffineExprPrint (MlirAffineExpr affineExpr, MlirStringCallback callback, void *userData)
 Prints an affine expression by sending chunks of the string representation and forwarding userData tocallback`. More...
 
MLIR_CAPI_EXPORTED void mlirAffineExprDump (MlirAffineExpr affineExpr)
 Prints the affine expression to the standard error stream. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsSymbolicOrConstant (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is made out of only symbols and constants. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsPureAffine (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is a pure affine expression, i.e. More...
 
MLIR_CAPI_EXPORTED int64_t mlirAffineExprGetLargestKnownDivisor (MlirAffineExpr affineExpr)
 Returns the greatest known integral divisor of this affine expression. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsMultipleOf (MlirAffineExpr affineExpr, int64_t factor)
 Checks whether the given affine expression is a multiple of 'factor'. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsFunctionOfDim (MlirAffineExpr affineExpr, intptr_t position)
 Checks whether the given affine expression involves AffineDimExpr 'position'. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineExprCompose (MlirAffineExpr affineExpr, struct MlirAffineMap affineMap)
 Composes the given map with the given expression. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsADim (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is a dimension expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineDimExprGet (MlirContext ctx, intptr_t position)
 Creates an affine dimension expression with 'position' in the context. More...
 
MLIR_CAPI_EXPORTED intptr_t mlirAffineDimExprGetPosition (MlirAffineExpr affineExpr)
 Returns the position of the given affine dimension expression. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsASymbol (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is a symbol expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineSymbolExprGet (MlirContext ctx, intptr_t position)
 Creates an affine symbol expression with 'position' in the context. More...
 
MLIR_CAPI_EXPORTED intptr_t mlirAffineSymbolExprGetPosition (MlirAffineExpr affineExpr)
 Returns the position of the given affine symbol expression. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsAConstant (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is a constant expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineConstantExprGet (MlirContext ctx, int64_t constant)
 Creates an affine constant expression with 'constant' in the context. More...
 
MLIR_CAPI_EXPORTED int64_t mlirAffineConstantExprGetValue (MlirAffineExpr affineExpr)
 Returns the value of the given affine constant expression. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsAAdd (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is an add expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineAddExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs)
 Creates an affine add expression with 'lhs' and 'rhs'. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsAMul (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is an mul expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineMulExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs)
 Creates an affine mul expression with 'lhs' and 'rhs'. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsAMod (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is an mod expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineModExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs)
 Creates an affine mod expression with 'lhs' and 'rhs'. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsAFloorDiv (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is an floordiv expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineFloorDivExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs)
 Creates an affine floordiv expression with 'lhs' and 'rhs'. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsACeilDiv (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is an ceildiv expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineCeilDivExprGet (MlirAffineExpr lhs, MlirAffineExpr rhs)
 Creates an affine ceildiv expression with 'lhs' and 'rhs'. More...
 
MLIR_CAPI_EXPORTED bool mlirAffineExprIsABinary (MlirAffineExpr affineExpr)
 Checks whether the given affine expression is binary. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineBinaryOpExprGetLHS (MlirAffineExpr affineExpr)
 Returns the left hand side affine expression of the given affine binary operation expression. More...
 
MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineBinaryOpExprGetRHS (MlirAffineExpr affineExpr)
 Returns the right hand side affine expression of the given affine binary operation expression. More...
 

Macro Definition Documentation

◆ DEFINE_C_API_STRUCT

#define DEFINE_C_API_STRUCT (   name,
  storage 
)
Value:
struct name { \
storage *ptr; \
}; \
typedef struct name name

Definition at line 32 of file AffineExpr.h.

Function Documentation

◆ DEFINE_C_API_STRUCT()

DEFINE_C_API_STRUCT ( MlirAffineExpr  ,
const void   
)

◆ mlirAffineAddExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineAddExprGet ( MlirAffineExpr  lhs,
MlirAffineExpr  rhs 
)

Creates an affine add expression with 'lhs' and 'rhs'.

Definition at line 120 of file AffineExpr.cpp.

Referenced by mlirAffineExprIsNull().

◆ mlirAffineBinaryOpExprGetLHS()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineBinaryOpExprGetLHS ( MlirAffineExpr  affineExpr)

Returns the left hand side affine expression of the given affine binary operation expression.

Definition at line 187 of file AffineExpr.cpp.

References unwrap(), and wrap().

◆ mlirAffineBinaryOpExprGetRHS()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineBinaryOpExprGetRHS ( MlirAffineExpr  affineExpr)

Returns the right hand side affine expression of the given affine binary operation expression.

Definition at line 191 of file AffineExpr.cpp.

References unwrap(), and wrap().

◆ mlirAffineCeilDivExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineCeilDivExprGet ( MlirAffineExpr  lhs,
MlirAffineExpr  rhs 
)

Creates an affine ceildiv expression with 'lhs' and 'rhs'.

Definition at line 173 of file AffineExpr.cpp.

◆ mlirAffineConstantExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineConstantExprGet ( MlirContext  ctx,
int64_t  constant 
)

Creates an affine constant expression with 'constant' in the context.

Definition at line 104 of file AffineExpr.cpp.

References mlir::getAffineConstantExpr(), unwrap(), and wrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineConstantExprGetValue()

MLIR_CAPI_EXPORTED int64_t mlirAffineConstantExprGetValue ( MlirAffineExpr  affineExpr)

Returns the value of the given affine constant expression.

Definition at line 108 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineDimExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineDimExprGet ( MlirContext  ctx,
intptr_t  position 
)

Creates an affine dimension expression with 'position' in the context.

Definition at line 72 of file AffineExpr.cpp.

References mlir::getAffineDimExpr(), unwrap(), and wrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineDimExprGetPosition()

MLIR_CAPI_EXPORTED intptr_t mlirAffineDimExprGetPosition ( MlirAffineExpr  affineExpr)

Returns the position of the given affine dimension expression.

Definition at line 76 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineExprCompose()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineExprCompose ( MlirAffineExpr  affineExpr,
struct MlirAffineMap  affineMap 
)

Composes the given map with the given expression.

Definition at line 59 of file AffineExpr.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::PyIntegerSet::createFromCapsule(), and mlirAffineExprIsNull().

◆ mlirAffineExprDump()

MLIR_CAPI_EXPORTED void mlirAffineExprDump ( MlirAffineExpr  affineExpr)

Prints the affine expression to the standard error stream.

Definition at line 34 of file AffineExpr.cpp.

References unwrap().

Referenced by mlir::python::PyIntegerSet::createFromCapsule(), and mlirAffineExprIsNull().

◆ mlirAffineExprEqual()

MLIR_CAPI_EXPORTED bool mlirAffineExprEqual ( MlirAffineExpr  lhs,
MlirAffineExpr  rhs 
)

Returns true if the two affine expressions are equal.

Definition at line 24 of file AffineExpr.cpp.

Referenced by mlir::python::PyAffineExpr::operator==().

◆ mlirAffineExprGetContext()

MLIR_CAPI_EXPORTED MlirContext mlirAffineExprGetContext ( MlirAffineExpr  affineExpr)

Gets the context that owns the affine expression.

Definition at line 20 of file AffineExpr.cpp.

References unwrap(), and wrap().

Referenced by mlir::python::PyAffineExpr::createFromCapsule().

◆ mlirAffineExprGetLargestKnownDivisor()

MLIR_CAPI_EXPORTED 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().

Referenced by mlirAffineExprIsNull().

◆ mlirAffineExprIsAAdd()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsAAdd ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is an add expression.

Definition at line 116 of file AffineExpr.cpp.

References mlir::Add, and unwrap().

Referenced by mlirAffineExprIsNull().

◆ mlirAffineExprIsABinary()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsABinary ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is binary.

Definition at line 183 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation().

◆ mlirAffineExprIsACeilDiv()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsACeilDiv ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is an ceildiv expression.

Definition at line 169 of file AffineExpr.cpp.

References mlir::CeilDiv, and unwrap().

◆ mlirAffineExprIsAConstant()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsAConstant ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is a constant expression.

Definition at line 100 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineExprIsADim()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsADim ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is a dimension expression.

Definition at line 68 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineExprIsAFloorDiv()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsAFloorDiv ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is an floordiv expression.

Definition at line 155 of file AffineExpr.cpp.

References mlir::FloorDiv, and unwrap().

◆ mlirAffineExprIsAMod()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsAMod ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is an mod expression.

Definition at line 142 of file AffineExpr.cpp.

References mlir::Mod, and unwrap().

◆ mlirAffineExprIsAMul()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsAMul ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is an mul expression.

Definition at line 129 of file AffineExpr.cpp.

References mlir::Mul, and unwrap().

◆ mlirAffineExprIsASymbol()

MLIR_CAPI_EXPORTED bool mlirAffineExprIsASymbol ( MlirAffineExpr  affineExpr)

Checks whether the given affine expression is a symbol expression.

Definition at line 84 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineExprIsFunctionOfDim()

MLIR_CAPI_EXPORTED 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().

Referenced by mlirAffineExprIsNull().

◆ mlirAffineExprIsMultipleOf()

MLIR_CAPI_EXPORTED 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().

Referenced by mlirAffineExprIsNull().

◆ mlirAffineExprIsNull()

static bool mlirAffineExprIsNull ( MlirAffineExpr  affineExpr)
inlinestatic

◆ mlirAffineExprIsPureAffine()

MLIR_CAPI_EXPORTED 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().

Referenced by mlirAffineExprIsNull().

◆ mlirAffineExprIsSymbolicOrConstant()

MLIR_CAPI_EXPORTED 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().

Referenced by mlirAffineExprIsNull().

◆ mlirAffineExprPrint()

MLIR_CAPI_EXPORTED void mlirAffineExprPrint ( MlirAffineExpr  affineExpr,
MlirStringCallback  callback,
void userData 
)

Prints an affine expression by sending chunks of the string representation and forwarding userData tocallback`.

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().

Referenced by mlir::python::PyIntegerSet::createFromCapsule(), and mlirAffineExprIsNull().

◆ mlirAffineFloorDivExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineFloorDivExprGet ( MlirAffineExpr  lhs,
MlirAffineExpr  rhs 
)

Creates an affine floordiv expression with 'lhs' and 'rhs'.

Definition at line 159 of file AffineExpr.cpp.

◆ mlirAffineModExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineModExprGet ( MlirAffineExpr  lhs,
MlirAffineExpr  rhs 
)

Creates an affine mod expression with 'lhs' and 'rhs'.

Definition at line 146 of file AffineExpr.cpp.

◆ mlirAffineMulExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineMulExprGet ( MlirAffineExpr  lhs,
MlirAffineExpr  rhs 
)

Creates an affine mul expression with 'lhs' and 'rhs'.

Definition at line 133 of file AffineExpr.cpp.

◆ mlirAffineSymbolExprGet()

MLIR_CAPI_EXPORTED MlirAffineExpr mlirAffineSymbolExprGet ( MlirContext  ctx,
intptr_t  position 
)

Creates an affine symbol expression with 'position' in the context.

Definition at line 88 of file AffineExpr.cpp.

References mlir::getAffineSymbolExpr(), unwrap(), and wrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().

◆ mlirAffineSymbolExprGetPosition()

MLIR_CAPI_EXPORTED intptr_t mlirAffineSymbolExprGetPosition ( MlirAffineExpr  affineExpr)

Returns the position of the given affine symbol expression.

Definition at line 92 of file AffineExpr.cpp.

References unwrap().

Referenced by isPermutation(), and mlirAffineExprIsNull().