MLIR  19.0.0git
Namespaces | Macros | Functions
AffineToStandard.cpp File Reference
#include "mlir/Conversion/AffineToStandard/AffineToStandard.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/Utils.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/IR/MLIRContext.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/Passes.h"
#include "mlir/Conversion/Passes.h.inc"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 

Macros

#define GEN_PASS_DEF_CONVERTAFFINETOSTANDARD
 

Functions

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. More...
 
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. More...
 
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. More...
 

Macro Definition Documentation

◆ GEN_PASS_DEF_CONVERTAFFINETOSTANDARD

#define GEN_PASS_DEF_CONVERTAFFINETOSTANDARD

Definition at line 28 of file AffineToStandard.cpp.

Function Documentation

◆ buildMinMaxReductionSeq()

static 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.

References mlir::OpBuilder::create().

Referenced by lowerAffineMapMax(), and lowerAffineMapMin().

◆ lowerAffineMapMax()

static 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(), and mlir::affine::expandAffineMap().

◆ lowerAffineMapMin()

static 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(), and mlir::affine::expandAffineMap().