MLIR  21.0.0git
Namespaces | Macros | Functions
FlattenMemRefs.cpp File Reference
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/MemRef/Transforms/Passes.h"
#include "mlir/Dialect/MemRef/Transforms/Transforms.h"
#include "mlir/Dialect/MemRef/Utils/MemRefUtils.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Utils/StaticValueUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/TypeSwitch.h"
#include <numeric>
#include "mlir/Dialect/MemRef/Transforms/Passes.h.inc"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::memref
 

Macros

#define GEN_PASS_DEF_FLATTENMEMREFSPASS
 

Functions

static Value getValueFromOpFoldResult (OpBuilder &rewriter, Location loc, OpFoldResult in)
 
static std::pair< Value, ValuegetFlattenMemrefAndOffset (OpBuilder &rewriter, Location loc, Value source, ValueRange indices)
 Returns a collapsed memref and the linearized index to access the element at the specified indices. More...
 
static bool needFlattening (Value val)
 
static bool checkLayout (Value val)
 

Macro Definition Documentation

◆ GEN_PASS_DEF_FLATTENMEMREFSPASS

#define GEN_PASS_DEF_FLATTENMEMREFSPASS

Definition at line 38 of file FlattenMemRefs.cpp.

Function Documentation

◆ checkLayout()

static bool checkLayout ( Value  val)
static

Definition at line 97 of file FlattenMemRefs.cpp.

References mlir::Value::getType().

◆ getFlattenMemrefAndOffset()

static std::pair<Value, Value> getFlattenMemrefAndOffset ( OpBuilder rewriter,
Location  loc,
Value  source,
ValueRange  indices 
)
static

Returns a collapsed memref and the linearized index to access the element at the specified indices.

Definition at line 56 of file FlattenMemRefs.cpp.

References mlir::OpBuilder::create(), mlir::getAsOpFoldResult(), mlir::memref::getLinearizedMemRefOffsetAndSize(), mlir::Value::getType(), getValueFromOpFoldResult(), and mlir::memref::LinearizedMemRefInfo::linearizedOffset.

◆ getValueFromOpFoldResult()

static Value getValueFromOpFoldResult ( OpBuilder rewriter,
Location  loc,
OpFoldResult  in 
)
static

Definition at line 45 of file FlattenMemRefs.cpp.

References mlir::OpBuilder::create().

Referenced by getFlattenMemrefAndOffset().

◆ needFlattening()

static bool needFlattening ( Value  val)
static

Definition at line 92 of file FlattenMemRefs.cpp.

References mlir::Value::getType().