MLIR 23.0.0git
AffineExpandIndexOps.cpp File Reference

Go to the source code of this file.

Namespaces

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

Macros

#define GEN_PASS_DEF_AFFINEEXPANDINDEXOPS

Functions

static SmallVector< ValuecomputeStrides (Location loc, RewriterBase &rewriter, ValueRange dynamicBasis, ArrayRef< int64_t > staticBasis, bool knownNonNegative)
 Given a basis (in static and dynamic components), return the sequence of suffix products of the basis, including the product of the entire basis, which must not contain an outer bound.
static Value broadcastToMatchType (RewriterBase &rewriter, Location loc, Value value, Type targetType)
 Broadcast a scalar value to match the given type.

Macro Definition Documentation

◆ GEN_PASS_DEF_AFFINEEXPANDINDEXOPS

#define GEN_PASS_DEF_AFFINEEXPANDINDEXOPS

Definition at line 23 of file AffineExpandIndexOps.cpp.

Function Documentation

◆ broadcastToMatchType()

Value broadcastToMatchType ( RewriterBase & rewriter,
Location loc,
Value value,
Type targetType )
static

Broadcast a scalar value to match the given type.

If the type is already scalar, returns the value as-is. For vector types, uses vector.broadcast.

Definition at line 89 of file AffineExpandIndexOps.cpp.

References mlir::Value::getType().

Referenced by mlir::affine::lowerAffineDelinearizeIndexOp(), and mlir::affine::lowerAffineLinearizeIndexOp().

◆ computeStrides()

SmallVector< Value > computeStrides ( Location loc,
RewriterBase & rewriter,
ValueRange dynamicBasis,
ArrayRef< int64_t > staticBasis,
bool knownNonNegative )
static

Given a basis (in static and dynamic components), return the sequence of suffix products of the basis, including the product of the entire basis, which must not contain an outer bound.

If excess dynamic values are provided, the values at the beginning will be ignored. This allows for dropping the outer bound without needing to manipulate the dynamic value array. knownPositive indicases that the values being used to compute the strides are known to be non-negative.

Definition at line 40 of file AffineExpandIndexOps.cpp.

References mlir::OpBuilder::createOrFold(), and result.