MLIR 22.0.0git
AffineToStandard.cpp File Reference

Go to the source code of this file.

Classes

class  mlir::impl::LowerAffinePassBase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::impl
 Attribute collections provide a dictionary-like interface.

Macros

#define GEN_PASS_DEF_LOWERAFFINEPASS

Functions

std::unique_ptr<::mlir::Passmlir::impl::createLowerAffinePass ()
std::unique_ptr<::mlir::Passmlir::createLowerAffinePass ()
static Value buildMinMaxReductionSeq (Location loc, arith::CmpIPredicate predicate, ValueRange values, OpBuilder &builder)
 Given a range of values, emit the code that reduces them with "min" or "max" depending on the provided comparison predicate, sgt for max and slt for min.
static Value lowerAffineMapMax (OpBuilder &builder, Location loc, AffineMap map, ValueRange operands)
 Emit instructions that correspond to computing the maximum value among the values of a (potentially) multi-output affine map applied to operands.
static Value lowerAffineMapMin (OpBuilder &builder, Location loc, AffineMap map, ValueRange operands)
 Emit instructions that correspond to computing the minimum value among the values of a (potentially) multi-output affine map applied to operands.

Macro Definition Documentation

◆ GEN_PASS_DEF_LOWERAFFINEPASS

#define GEN_PASS_DEF_LOWERAFFINEPASS

Definition at line 28 of file AffineToStandard.cpp.

Function Documentation

◆ buildMinMaxReductionSeq()

Value buildMinMaxReductionSeq ( Location loc,
arith::CmpIPredicate predicate,
ValueRange values,
OpBuilder & builder )
static

Given a range of values, emit the code that reduces them with "min" or "max" depending on the provided comparison predicate, sgt for max and slt for min.

Multiple values are scanned in a linear sequence. This creates a data dependences that wouldn't exist in a tree reduction, but is easier to recognize as a reduction by the subsequent passes.

Definition at line 42 of file AffineToStandard.cpp.

Referenced by lowerAffineMapMax(), and lowerAffineMapMin().

◆ lowerAffineMapMax()

Value lowerAffineMapMax ( OpBuilder & builder,
Location loc,
AffineMap map,
ValueRange operands )
static

Emit instructions that correspond to computing the maximum value among the values of a (potentially) multi-output affine map applied to operands.

Definition at line 63 of file AffineToStandard.cpp.

References buildMinMaxReductionSeq().

◆ lowerAffineMapMin()

Value lowerAffineMapMin ( OpBuilder & builder,
Location loc,
AffineMap map,
ValueRange operands )
static

Emit instructions that correspond to computing the minimum value among the values of a (potentially) multi-output affine map applied to operands.

Definition at line 73 of file AffineToStandard.cpp.

References buildMinMaxReductionSeq().