MLIR  19.0.0git
Macros | Typedefs | Functions | Variables
Utils.cpp File Reference
#include "mlir/Dialect/Affine/Analysis/Utils.h"
#include "mlir/Analysis/Presburger/PresburgerRelation.h"
#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/Interfaces/CallInterfaces.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "analysis-utils"
 

Typedefs

using Node = MemRefDependenceGraph::Node
 

Functions

static void findInstPosition (Operation *op, Block *limitBlock, SmallVectorImpl< unsigned > *positions)
 
static OperationgetInstAtPosition (ArrayRef< unsigned > positions, unsigned level, Block *block)
 
static LogicalResult addMissingLoopIVBounds (SmallPtrSet< Value, 8 > &ivs, FlatAffineValueConstraints *cst)
 
static std::optional< uint64_t > getConstDifference (AffineMap lbMap, AffineMap ubMap)
 
static std::optional< int64_t > getMemoryFootprintBytes (Block &block, Block::iterator start, Block::iterator end, int memorySpace)
 
static void unpackOptionalValues (ArrayRef< std::optional< Value >> source, SmallVector< Value > &target)
 
static LogicalResult alignAndAddBound (FlatAffineValueConstraints &constraints, BoundType type, unsigned pos, AffineMap map, ValueRange operands)
 Bound an identifier pos in a given FlatAffineValueConstraints with constraints drawn from an affine map. More...
 
static AffineMap addConstToResults (AffineMap map, int64_t val)
 Add val to each result of map. More...
 

Variables

const char *const kSliceFusionBarrierAttrName = "slice_fusion_barrier"
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "analysis-utils"

Definition at line 30 of file Utils.cpp.

Typedef Documentation

◆ Node

Definition at line 38 of file Utils.cpp.

Function Documentation

◆ addConstToResults()

static AffineMap addConstToResults ( AffineMap  map,
int64_t  val 
)
static

◆ addMissingLoopIVBounds()

static LogicalResult addMissingLoopIVBounds ( SmallPtrSet< Value, 8 > &  ivs,
FlatAffineValueConstraints cst 
)
static

◆ alignAndAddBound()

static LogicalResult alignAndAddBound ( FlatAffineValueConstraints constraints,
BoundType  type,
unsigned  pos,
AffineMap  map,
ValueRange  operands 
)
static

Bound an identifier pos in a given FlatAffineValueConstraints with constraints drawn from an affine map.

Before adding the constraint, the dimensions/symbols of the affine map are aligned with constraints. operands are the SSA Value operands used with the affine map. Note: This function adds a new symbol column to the constraints for each dimension/symbol that exists in the affine map but not in constraints.

Definition at line 2006 of file Utils.cpp.

References mlir::affine::FlatAffineValueConstraints::addBound(), mlir::alignAffineMapWithValues(), mlir::FlatLinearValueConstraints::appendSymbolVar(), mlir::FlatLinearValueConstraints::getMaybeValues(), and unpackOptionalValues().

◆ findInstPosition()

static void findInstPosition ( Operation op,
Block limitBlock,
SmallVectorImpl< unsigned > *  positions 
)
static

Definition at line 1327 of file Utils.cpp.

Referenced by mlir::affine::insertBackwardComputationSlice().

◆ getConstDifference()

static std::optional<uint64_t> getConstDifference ( AffineMap  lbMap,
AffineMap  ubMap 
)
static

◆ getInstAtPosition()

static Operation* getInstAtPosition ( ArrayRef< unsigned >  positions,
unsigned  level,
Block block 
)
static

Definition at line 1344 of file Utils.cpp.

Referenced by mlir::affine::insertBackwardComputationSlice().

◆ getMemoryFootprintBytes()

static std::optional<int64_t> getMemoryFootprintBytes ( Block block,
Block::iterator  start,
Block::iterator  end,
int  memorySpace 
)
static

◆ unpackOptionalValues()

static void unpackOptionalValues ( ArrayRef< std::optional< Value >>  source,
SmallVector< Value > &  target 
)
static

Definition at line 1992 of file Utils.cpp.

Referenced by alignAndAddBound().

Variable Documentation

◆ kSliceFusionBarrierAttrName

const char* const kSliceFusionBarrierAttrName = "slice_fusion_barrier"

Definition at line 1648 of file Utils.cpp.

Referenced by mlir::affine::getComputationSliceState().