MLIR 23.0.0git
SimplifyAffineWithBounds.cpp File Reference

Go to the source code of this file.

Classes

class  mlir::affine::impl::SimplifyAffineWithBoundsBase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::affine
namespace  mlir::affine::impl

Macros

#define DEBUG_TYPE   "affine-simplify-with-bounds"
#define GEN_PASS_DEF_SIMPLIFYAFFINEWITHBOUNDS

Functions

static void buildProductExpr (OpFoldResult basis, AffineExpr &productExpr, SmallVectorImpl< Value > &operands, MLIRContext *ctx)
 Accumulate a single basis element into the running product expression.
static std::optional< size_t > tryMatchProduct (ArrayRef< OpFoldResult > lhs, size_t lhsTailConsumed, ArrayRef< OpFoldResult > rhs, size_t rhsTailConsumed, MLIRContext *ctx)
 Try to find k consecutive elements from lhs (starting from tail offset) whose product equals the single next element from rhs.
std::unique_ptr<::mlir::Passmlir::affine::impl::createSimplifyAffineWithBounds ()
std::unique_ptr<::mlir::Passmlir::affine::createSimplifyAffineWithBounds ()

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "affine-simplify-with-bounds"

Definition at line 24 of file SimplifyAffineWithBounds.cpp.

◆ GEN_PASS_DEF_SIMPLIFYAFFINEWITHBOUNDS

#define GEN_PASS_DEF_SIMPLIFYAFFINEWITHBOUNDS

Definition at line 234 of file SimplifyAffineWithBounds.cpp.

Function Documentation

◆ buildProductExpr()

void buildProductExpr ( OpFoldResult basis,
AffineExpr & productExpr,
SmallVectorImpl< Value > & operands,
MLIRContext * ctx )
static

Accumulate a single basis element into the running product expression.

Static values become affine constants, and dynamic values become symbols.

Definition at line 31 of file SimplifyAffineWithBounds.cpp.

References mlir::getAffineConstantExpr(), mlir::getAffineSymbolExpr(), and mlir::getConstantIntValue().

Referenced by tryMatchProduct().

◆ tryMatchProduct()

std::optional< size_t > tryMatchProduct ( ArrayRef< OpFoldResult > lhs,
size_t lhsTailConsumed,
ArrayRef< OpFoldResult > rhs,
size_t rhsTailConsumed,
MLIRContext * ctx )
static

Try to find k consecutive elements from lhs (starting from tail offset) whose product equals the single next element from rhs.

The product is accumulated incrementally to avoid redundant computation. Returns the number of matched elements k, or std::nullopt if no match.

Definition at line 46 of file SimplifyAffineWithBounds.cpp.

References mlir::ValueBoundsConstraintSet::areEqual(), buildProductExpr(), mlir::AffineMap::get(), mlir::getAffineConstantExpr(), lhs, result, and rhs.