#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/UB/IR/UBOps.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/ShapedOpInterfaces.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
#include "mlir/Transforms/InliningUtils.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
#include <numeric>
#include <optional>
usingnamespacemlir;
usingnamespacemlir::affine;
divideCeilSigned;
divideFloorSigned;
mod;
#define DEBUG_TYPE …
#include "mlir/Dialect/Affine/IR/AffineOpsDialect.cpp.inc"
bool mlir::affine::isTopLevelValue(Value value, Region *region) { … }
static bool
remainsLegalAfterInline(Value value, Region *src, Region *dest,
const IRMapping &mapping,
function_ref<bool(Value, Region *)> legalityCheck) { … }
static bool
remainsLegalAfterInline(ValueRange values, Region *src, Region *dest,
const IRMapping &mapping,
function_ref<bool(Value, Region *)> legalityCheck) { … }
template <typename OpTy>
static bool remainsLegalAfterInline(OpTy op, Region *src, Region *dest,
const IRMapping &mapping) { … }
template <>
bool LLVM_ATTRIBUTE_UNUSED remainsLegalAfterInline(AffineApplyOp op,
Region *src, Region *dest,
const IRMapping &mapping) { … }
namespace {
struct AffineInlinerInterface : public DialectInlinerInterface { … };
}
void AffineDialect::initialize() { … }
Operation *AffineDialect::materializeConstant(OpBuilder &builder,
Attribute value, Type type,
Location loc) { … }
bool mlir::affine::isTopLevelValue(Value value) { … }
Region *mlir::affine::getAffineScope(Operation *op) { … }
bool mlir::affine::isValidDim(Value value) { … }
bool mlir::affine::isValidDim(Value value, Region *region) { … }
template <typename AnyMemRefDefOp>
static bool isMemRefSizeValidSymbol(AnyMemRefDefOp memrefDefOp, unsigned index,
Region *region) { … }
static bool isDimOpValidSymbol(ShapedDimOpInterface dimOp, Region *region) { … }
bool mlir::affine::isValidSymbol(Value value) { … }
bool mlir::affine::isValidSymbol(Value value, Region *region) { … }
static bool isValidAffineIndexOperand(Value value, Region *region) { … }
static void printDimAndSymbolList(Operation::operand_iterator begin,
Operation::operand_iterator end,
unsigned numDims, OpAsmPrinter &printer) { … }
ParseResult mlir::affine::parseDimAndSymbolList(
OpAsmParser &parser, SmallVectorImpl<Value> &operands, unsigned &numDims) { … }
template <typename OpTy>
static LogicalResult
verifyDimAndSymbolIdentifiers(OpTy &op, Operation::operand_range operands,
unsigned numDims) { … }
AffineValueMap AffineApplyOp::getAffineValueMap() { … }
ParseResult AffineApplyOp::parse(OpAsmParser &parser, OperationState &result) { … }
void AffineApplyOp::print(OpAsmPrinter &p) { … }
LogicalResult AffineApplyOp::verify() { … }
bool AffineApplyOp::isValidDim() { … }
bool AffineApplyOp::isValidDim(Region *region) { … }
bool AffineApplyOp::isValidSymbol() { … }
bool AffineApplyOp::isValidSymbol(Region *region) { … }
OpFoldResult AffineApplyOp::fold(FoldAdaptor adaptor) { … }
static int64_t getLargestKnownDivisor(AffineExpr e, ArrayRef<Value> operands) { … }
static bool isNonNegativeBoundedBy(AffineExpr e, ArrayRef<Value> operands,
int64_t k) { … }
static bool isQTimesDPlusR(AffineExpr e, ArrayRef<Value> operands, int64_t &div,
AffineExpr "ientTimesDiv, AffineExpr &rem) { … }
static std::optional<int64_t> getLowerBound(Value iv) { … }
static std::optional<int64_t> getUpperBound(Value iv) { … }
static std::optional<int64_t> getUpperBound(AffineExpr expr, unsigned numDims,
unsigned numSymbols,
ArrayRef<Value> operands) { … }
static std::optional<int64_t> getLowerBound(AffineExpr expr, unsigned numDims,
unsigned numSymbols,
ArrayRef<Value> operands) { … }
static void simplifyExprAndOperands(AffineExpr &expr, unsigned numDims,
unsigned numSymbols,
ArrayRef<Value> operands) { … }
static void simplifyMinOrMaxExprWithOperands(AffineMap &map,
ArrayRef<Value> operands,
bool isMax) { … }
static void LLVM_ATTRIBUTE_UNUSED
simplifyMapWithOperands(AffineMap &map, ArrayRef<Value> operands) { … }
static LogicalResult replaceDimOrSym(AffineMap *map,
unsigned dimOrSymbolPosition,
SmallVectorImpl<Value> &dims,
SmallVectorImpl<Value> &syms) { … }
static void composeAffineMapAndOperands(AffineMap *map,
SmallVectorImpl<Value> *operands) { … }
void mlir::affine::fullyComposeAffineMapAndOperands(
AffineMap *map, SmallVectorImpl<Value> *operands) { … }
AffineApplyOp
mlir::affine::makeComposedAffineApply(OpBuilder &b, Location loc, AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
AffineApplyOp
mlir::affine::makeComposedAffineApply(OpBuilder &b, Location loc, AffineExpr e,
ArrayRef<OpFoldResult> operands) { … }
static void composeMultiResultAffineMap(AffineMap &map,
SmallVectorImpl<Value> &operands) { … }
OpFoldResult
mlir::affine::makeComposedFoldedAffineApply(OpBuilder &b, Location loc,
AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
OpFoldResult
mlir::affine::makeComposedFoldedAffineApply(OpBuilder &b, Location loc,
AffineExpr expr,
ArrayRef<OpFoldResult> operands) { … }
SmallVector<OpFoldResult>
mlir::affine::makeComposedFoldedMultiResultAffineApply(
OpBuilder &b, Location loc, AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
template <typename OpTy>
static OpTy makeComposedMinMax(OpBuilder &b, Location loc, AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
AffineMinOp
mlir::affine::makeComposedAffineMin(OpBuilder &b, Location loc, AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
template <typename OpTy>
static OpFoldResult makeComposedFoldedMinMax(OpBuilder &b, Location loc,
AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
OpFoldResult
mlir::affine::makeComposedFoldedAffineMin(OpBuilder &b, Location loc,
AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
OpFoldResult
mlir::affine::makeComposedFoldedAffineMax(OpBuilder &b, Location loc,
AffineMap map,
ArrayRef<OpFoldResult> operands) { … }
template <class MapOrSet>
static void canonicalizePromotedSymbols(MapOrSet *mapOrSet,
SmallVectorImpl<Value> *operands) { … }
template <class MapOrSet>
static void canonicalizeMapOrSetAndOperands(MapOrSet *mapOrSet,
SmallVectorImpl<Value> *operands) { … }
void mlir::affine::canonicalizeMapAndOperands(
AffineMap *map, SmallVectorImpl<Value> *operands) { … }
void mlir::affine::canonicalizeSetAndOperands(
IntegerSet *set, SmallVectorImpl<Value> *operands) { … }
namespace {
template <typename AffineOpTy>
struct SimplifyAffineOp : public OpRewritePattern<AffineOpTy> { … };
template <>
void SimplifyAffineOp<AffineLoadOp>::replaceAffineOp(
PatternRewriter &rewriter, AffineLoadOp load, AffineMap map,
ArrayRef<Value> mapOperands) const { … }
template <>
void SimplifyAffineOp<AffinePrefetchOp>::replaceAffineOp(
PatternRewriter &rewriter, AffinePrefetchOp prefetch, AffineMap map,
ArrayRef<Value> mapOperands) const { … }
template <>
void SimplifyAffineOp<AffineStoreOp>::replaceAffineOp(
PatternRewriter &rewriter, AffineStoreOp store, AffineMap map,
ArrayRef<Value> mapOperands) const { … }
template <>
void SimplifyAffineOp<AffineVectorLoadOp>::replaceAffineOp(
PatternRewriter &rewriter, AffineVectorLoadOp vectorload, AffineMap map,
ArrayRef<Value> mapOperands) const { … }
template <>
void SimplifyAffineOp<AffineVectorStoreOp>::replaceAffineOp(
PatternRewriter &rewriter, AffineVectorStoreOp vectorstore, AffineMap map,
ArrayRef<Value> mapOperands) const { … }
template <typename AffineOpTy>
void SimplifyAffineOp<AffineOpTy>::replaceAffineOp(
PatternRewriter &rewriter, AffineOpTy op, AffineMap map,
ArrayRef<Value> mapOperands) const { … }
}
void AffineApplyOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
void AffineDmaStartOp::build(OpBuilder &builder, OperationState &result,
Value srcMemRef, AffineMap srcMap,
ValueRange srcIndices, Value destMemRef,
AffineMap dstMap, ValueRange destIndices,
Value tagMemRef, AffineMap tagMap,
ValueRange tagIndices, Value numElements,
Value stride, Value elementsPerStride) { … }
void AffineDmaStartOp::print(OpAsmPrinter &p) { … }
ParseResult AffineDmaStartOp::parse(OpAsmParser &parser,
OperationState &result) { … }
LogicalResult AffineDmaStartOp::verifyInvariantsImpl() { … }
LogicalResult AffineDmaStartOp::fold(ArrayRef<Attribute> cstOperands,
SmallVectorImpl<OpFoldResult> &results) { … }
void AffineDmaStartOp::getEffects(
SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>>
&effects) { … }
void AffineDmaWaitOp::build(OpBuilder &builder, OperationState &result,
Value tagMemRef, AffineMap tagMap,
ValueRange tagIndices, Value numElements) { … }
void AffineDmaWaitOp::print(OpAsmPrinter &p) { … }
ParseResult AffineDmaWaitOp::parse(OpAsmParser &parser,
OperationState &result) { … }
LogicalResult AffineDmaWaitOp::verifyInvariantsImpl() { … }
LogicalResult AffineDmaWaitOp::fold(ArrayRef<Attribute> cstOperands,
SmallVectorImpl<OpFoldResult> &results) { … }
void AffineDmaWaitOp::getEffects(
SmallVectorImpl<SideEffects::EffectInstance<MemoryEffects::Effect>>
&effects) { … }
void AffineForOp::build(OpBuilder &builder, OperationState &result,
ValueRange lbOperands, AffineMap lbMap,
ValueRange ubOperands, AffineMap ubMap, int64_t step,
ValueRange iterArgs, BodyBuilderFn bodyBuilder) { … }
void AffineForOp::build(OpBuilder &builder, OperationState &result, int64_t lb,
int64_t ub, int64_t step, ValueRange iterArgs,
BodyBuilderFn bodyBuilder) { … }
LogicalResult AffineForOp::verifyRegions() { … }
static ParseResult parseBound(bool isLower, OperationState &result,
OpAsmParser &p) { … }
ParseResult AffineForOp::parse(OpAsmParser &parser, OperationState &result) { … }
static void printBound(AffineMapAttr boundMap,
Operation::operand_range boundOperands,
const char *prefix, OpAsmPrinter &p) { … }
unsigned AffineForOp::getNumIterOperands() { … }
std::optional<MutableArrayRef<OpOperand>>
AffineForOp::getYieldedValuesMutable() { … }
void AffineForOp::print(OpAsmPrinter &p) { … }
static LogicalResult foldLoopBounds(AffineForOp forOp) { … }
static LogicalResult canonicalizeLoopBounds(AffineForOp forOp) { … }
namespace {
static std::optional<uint64_t> getTrivialConstantTripCount(AffineForOp forOp) { … }
struct AffineForEmptyLoopFolder : public OpRewritePattern<AffineForOp> { … };
}
void AffineForOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
OperandRange AffineForOp::getEntrySuccessorOperands(RegionBranchPoint point) { … }
void AffineForOp::getSuccessorRegions(
RegionBranchPoint point, SmallVectorImpl<RegionSuccessor> ®ions) { … }
static bool hasTrivialZeroTripCount(AffineForOp op) { … }
LogicalResult AffineForOp::fold(FoldAdaptor adaptor,
SmallVectorImpl<OpFoldResult> &results) { … }
AffineBound AffineForOp::getLowerBound() { … }
AffineBound AffineForOp::getUpperBound() { … }
void AffineForOp::setLowerBound(ValueRange lbOperands, AffineMap map) { … }
void AffineForOp::setUpperBound(ValueRange ubOperands, AffineMap map) { … }
bool AffineForOp::hasConstantLowerBound() { … }
bool AffineForOp::hasConstantUpperBound() { … }
int64_t AffineForOp::getConstantLowerBound() { … }
int64_t AffineForOp::getConstantUpperBound() { … }
void AffineForOp::setConstantLowerBound(int64_t value) { … }
void AffineForOp::setConstantUpperBound(int64_t value) { … }
AffineForOp::operand_range AffineForOp::getControlOperands() { … }
bool AffineForOp::matchingBoundOperandList() { … }
SmallVector<Region *> AffineForOp::getLoopRegions() { … }
std::optional<SmallVector<Value>> AffineForOp::getLoopInductionVars() { … }
std::optional<SmallVector<OpFoldResult>> AffineForOp::getLoopLowerBounds() { … }
std::optional<SmallVector<OpFoldResult>> AffineForOp::getLoopSteps() { … }
std::optional<SmallVector<OpFoldResult>> AffineForOp::getLoopUpperBounds() { … }
FailureOr<LoopLikeOpInterface> AffineForOp::replaceWithAdditionalYields(
RewriterBase &rewriter, ValueRange newInitOperands,
bool replaceInitOperandUsesInLoop,
const NewYieldValuesFn &newYieldValuesFn) { … }
Speculation::Speculatability AffineForOp::getSpeculatability() { … }
bool mlir::affine::isAffineForInductionVar(Value val) { … }
bool mlir::affine::isAffineParallelInductionVar(Value val) { … }
bool mlir::affine::isAffineInductionVar(Value val) { … }
AffineForOp mlir::affine::getForInductionVarOwner(Value val) { … }
AffineParallelOp mlir::affine::getAffineParallelInductionVarOwner(Value val) { … }
void mlir::affine::extractForInductionVars(ArrayRef<AffineForOp> forInsts,
SmallVectorImpl<Value> *ivs) { … }
void mlir::affine::extractInductionVars(ArrayRef<mlir::Operation *> affineOps,
SmallVectorImpl<mlir::Value> &ivs) { … }
template <typename BoundListTy, typename LoopCreatorTy>
static void buildAffineLoopNestImpl(
OpBuilder &builder, Location loc, BoundListTy lbs, BoundListTy ubs,
ArrayRef<int64_t> steps,
function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilderFn,
LoopCreatorTy &&loopCreatorFn) { … }
static AffineForOp
buildAffineLoopFromConstants(OpBuilder &builder, Location loc, int64_t lb,
int64_t ub, int64_t step,
AffineForOp::BodyBuilderFn bodyBuilderFn) { … }
static AffineForOp
buildAffineLoopFromValues(OpBuilder &builder, Location loc, Value lb, Value ub,
int64_t step,
AffineForOp::BodyBuilderFn bodyBuilderFn) { … }
void mlir::affine::buildAffineLoopNest(
OpBuilder &builder, Location loc, ArrayRef<int64_t> lbs,
ArrayRef<int64_t> ubs, ArrayRef<int64_t> steps,
function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilderFn) { … }
void mlir::affine::buildAffineLoopNest(
OpBuilder &builder, Location loc, ValueRange lbs, ValueRange ubs,
ArrayRef<int64_t> steps,
function_ref<void(OpBuilder &, Location, ValueRange)> bodyBuilderFn) { … }
namespace {
struct SimplifyDeadElse : public OpRewritePattern<AffineIfOp> { … };
struct AlwaysTrueOrFalseIf : public OpRewritePattern<AffineIfOp> { … };
}
void AffineIfOp::getSuccessorRegions(
RegionBranchPoint point, SmallVectorImpl<RegionSuccessor> ®ions) { … }
LogicalResult AffineIfOp::verify() { … }
ParseResult AffineIfOp::parse(OpAsmParser &parser, OperationState &result) { … }
void AffineIfOp::print(OpAsmPrinter &p) { … }
IntegerSet AffineIfOp::getIntegerSet() { … }
void AffineIfOp::setIntegerSet(IntegerSet newSet) { … }
void AffineIfOp::setConditional(IntegerSet set, ValueRange operands) { … }
void AffineIfOp::build(OpBuilder &builder, OperationState &result,
TypeRange resultTypes, IntegerSet set, ValueRange args,
bool withElseRegion) { … }
void AffineIfOp::build(OpBuilder &builder, OperationState &result,
IntegerSet set, ValueRange args, bool withElseRegion) { … }
static void composeSetAndOperands(IntegerSet &set,
SmallVectorImpl<Value> &operands) { … }
LogicalResult AffineIfOp::fold(FoldAdaptor, SmallVectorImpl<OpFoldResult> &) { … }
void AffineIfOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
void AffineLoadOp::build(OpBuilder &builder, OperationState &result,
AffineMap map, ValueRange operands) { … }
void AffineLoadOp::build(OpBuilder &builder, OperationState &result,
Value memref, AffineMap map, ValueRange mapOperands) { … }
void AffineLoadOp::build(OpBuilder &builder, OperationState &result,
Value memref, ValueRange indices) { … }
ParseResult AffineLoadOp::parse(OpAsmParser &parser, OperationState &result) { … }
void AffineLoadOp::print(OpAsmPrinter &p) { … }
static LogicalResult
verifyMemoryOpIndexing(Operation *op, AffineMapAttr mapAttr,
Operation::operand_range mapOperands,
MemRefType memrefType, unsigned numIndexOperands) { … }
LogicalResult AffineLoadOp::verify() { … }
void AffineLoadOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
OpFoldResult AffineLoadOp::fold(FoldAdaptor adaptor) { … }
void AffineStoreOp::build(OpBuilder &builder, OperationState &result,
Value valueToStore, Value memref, AffineMap map,
ValueRange mapOperands) { … }
void AffineStoreOp::build(OpBuilder &builder, OperationState &result,
Value valueToStore, Value memref,
ValueRange indices) { … }
ParseResult AffineStoreOp::parse(OpAsmParser &parser, OperationState &result) { … }
void AffineStoreOp::print(OpAsmPrinter &p) { … }
LogicalResult AffineStoreOp::verify() { … }
void AffineStoreOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
LogicalResult AffineStoreOp::fold(FoldAdaptor adaptor,
SmallVectorImpl<OpFoldResult> &results) { … }
template <typename T>
static LogicalResult verifyAffineMinMaxOp(T op) { … }
template <typename T>
static void printAffineMinMaxOp(OpAsmPrinter &p, T op) { … }
template <typename T>
static ParseResult parseAffineMinMaxOp(OpAsmParser &parser,
OperationState &result) { … }
template <typename T>
static OpFoldResult foldMinMaxOp(T op, ArrayRef<Attribute> operands) { … }
template <typename T>
struct DeduplicateAffineMinMaxExpressions : public OpRewritePattern<T> { … };
template <typename T>
struct MergeAffineMinMaxOp : public OpRewritePattern<T> { … };
static LogicalResult canonicalizeMapExprAndTermOrder(AffineMap &map) { … }
template <typename T>
struct CanonicalizeAffineMinMaxOpExprAndTermOrder : public OpRewritePattern<T> { … };
template <typename T>
struct CanonicalizeSingleResultAffineMinMaxOp : public OpRewritePattern<T> { … };
OpFoldResult AffineMinOp::fold(FoldAdaptor adaptor) { … }
void AffineMinOp::getCanonicalizationPatterns(RewritePatternSet &patterns,
MLIRContext *context) { … }
LogicalResult AffineMinOp::verify() { … }
ParseResult AffineMinOp::parse(OpAsmParser &parser, OperationState &result) { … }
void AffineMinOp::print(OpAsmPrinter &p) { … }
OpFoldResult AffineMaxOp::fold(FoldAdaptor adaptor) { … }
void AffineMaxOp::getCanonicalizationPatterns(RewritePatternSet &patterns,
MLIRContext *context) { … }
LogicalResult AffineMaxOp::verify() { … }
ParseResult AffineMaxOp::parse(OpAsmParser &parser, OperationState &result) { … }
void AffineMaxOp::print(OpAsmPrinter &p) { … }
ParseResult AffinePrefetchOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void AffinePrefetchOp::print(OpAsmPrinter &p) { … }
LogicalResult AffinePrefetchOp::verify() { … }
void AffinePrefetchOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
LogicalResult AffinePrefetchOp::fold(FoldAdaptor adaptor,
SmallVectorImpl<OpFoldResult> &results) { … }
void AffineParallelOp::build(OpBuilder &builder, OperationState &result,
TypeRange resultTypes,
ArrayRef<arith::AtomicRMWKind> reductions,
ArrayRef<int64_t> ranges) { … }
void AffineParallelOp::build(OpBuilder &builder, OperationState &result,
TypeRange resultTypes,
ArrayRef<arith::AtomicRMWKind> reductions,
ArrayRef<AffineMap> lbMaps, ValueRange lbArgs,
ArrayRef<AffineMap> ubMaps, ValueRange ubArgs,
ArrayRef<int64_t> steps) { … }
SmallVector<Region *> AffineParallelOp::getLoopRegions() { … }
unsigned AffineParallelOp::getNumDims() { … }
AffineParallelOp::operand_range AffineParallelOp::getLowerBoundsOperands() { … }
AffineParallelOp::operand_range AffineParallelOp::getUpperBoundsOperands() { … }
AffineMap AffineParallelOp::getLowerBoundMap(unsigned pos) { … }
AffineMap AffineParallelOp::getUpperBoundMap(unsigned pos) { … }
AffineValueMap AffineParallelOp::getLowerBoundsValueMap() { … }
AffineValueMap AffineParallelOp::getUpperBoundsValueMap() { … }
std::optional<SmallVector<int64_t, 8>> AffineParallelOp::getConstantRanges() { … }
Block *AffineParallelOp::getBody() { … }
OpBuilder AffineParallelOp::getBodyBuilder() { … }
void AffineParallelOp::setLowerBounds(ValueRange lbOperands, AffineMap map) { … }
void AffineParallelOp::setUpperBounds(ValueRange ubOperands, AffineMap map) { … }
void AffineParallelOp::setSteps(ArrayRef<int64_t> newSteps) { … }
static bool isResultTypeMatchAtomicRMWKind(Type resultType,
arith::AtomicRMWKind op) { … }
LogicalResult AffineParallelOp::verify() { … }
LogicalResult AffineValueMap::canonicalize() { … }
static LogicalResult canonicalizeLoopBounds(AffineParallelOp op) { … }
LogicalResult AffineParallelOp::fold(FoldAdaptor adaptor,
SmallVectorImpl<OpFoldResult> &results) { … }
static void printMinMaxBound(OpAsmPrinter &p, AffineMapAttr mapAttr,
DenseIntElementsAttr group, ValueRange operands,
StringRef keyword) { … }
void AffineParallelOp::print(OpAsmPrinter &p) { … }
static ParseResult deduplicateAndResolveOperands(
OpAsmParser &parser,
ArrayRef<SmallVector<OpAsmParser::UnresolvedOperand>> operands,
SmallVectorImpl<Value> &uniqueOperands,
SmallVectorImpl<AffineExpr> &replacements, AffineExprKind kind) { … }
namespace {
enum class MinMaxKind { … };
}
static ParseResult parseAffineMapWithMinMax(OpAsmParser &parser,
OperationState &result,
MinMaxKind kind) { … }
ParseResult AffineParallelOp::parse(OpAsmParser &parser,
OperationState &result) { … }
LogicalResult AffineYieldOp::verify() { … }
void AffineVectorLoadOp::build(OpBuilder &builder, OperationState &result,
VectorType resultType, AffineMap map,
ValueRange operands) { … }
void AffineVectorLoadOp::build(OpBuilder &builder, OperationState &result,
VectorType resultType, Value memref,
AffineMap map, ValueRange mapOperands) { … }
void AffineVectorLoadOp::build(OpBuilder &builder, OperationState &result,
VectorType resultType, Value memref,
ValueRange indices) { … }
void AffineVectorLoadOp::getCanonicalizationPatterns(RewritePatternSet &results,
MLIRContext *context) { … }
ParseResult AffineVectorLoadOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void AffineVectorLoadOp::print(OpAsmPrinter &p) { … }
static LogicalResult verifyVectorMemoryOp(Operation *op, MemRefType memrefType,
VectorType vectorType) { … }
LogicalResult AffineVectorLoadOp::verify() { … }
void AffineVectorStoreOp::build(OpBuilder &builder, OperationState &result,
Value valueToStore, Value memref, AffineMap map,
ValueRange mapOperands) { … }
void AffineVectorStoreOp::build(OpBuilder &builder, OperationState &result,
Value valueToStore, Value memref,
ValueRange indices) { … }
void AffineVectorStoreOp::getCanonicalizationPatterns(
RewritePatternSet &results, MLIRContext *context) { … }
ParseResult AffineVectorStoreOp::parse(OpAsmParser &parser,
OperationState &result) { … }
void AffineVectorStoreOp::print(OpAsmPrinter &p) { … }
LogicalResult AffineVectorStoreOp::verify() { … }
LogicalResult AffineDelinearizeIndexOp::inferReturnTypes(
MLIRContext *context, std::optional<::mlir::Location> location,
ValueRange operands, DictionaryAttr attributes, OpaqueProperties properties,
RegionRange regions, SmallVectorImpl<Type> &inferredReturnTypes) { … }
void AffineDelinearizeIndexOp::build(OpBuilder &builder, OperationState &result,
Value linearIndex,
ArrayRef<OpFoldResult> basis) { … }
LogicalResult AffineDelinearizeIndexOp::verify() { … }
namespace {
struct DropUnitExtentBasis
: public OpRewritePattern<affine::AffineDelinearizeIndexOp> { … };
struct DropDelinearizeOfSingleLoop
: public OpRewritePattern<affine::AffineDelinearizeIndexOp> { … };
}
void affine::AffineDelinearizeIndexOp::getCanonicalizationPatterns(
RewritePatternSet &patterns, MLIRContext *context) { … }
#define GET_OP_CLASSES
#include "mlir/Dialect/Affine/IR/AffineOps.cpp.inc"