MLIR 22.0.0git
Mem2Reg.cpp File Reference
#include "mlir/Transforms/Mem2Reg.h"
#include "mlir/Analysis/DataLayoutAnalysis.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Analysis/TopologicalSortUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/RegionKindInterface.h"
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/MemorySlotInterfaces.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/GenericIteratedDominanceFrontier.h"
#include "mlir/Transforms/Passes.h.inc"

Go to the source code of this file.

Classes

class  mlir::impl::Mem2RegBase< DerivedT >

Namespaces

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

Macros

#define GEN_PASS_DEF_MEM2REG
#define DEBUG_TYPE   "mem2reg"

Typedefs

using IDFCalculator = llvm::IDFCalculatorBase<Block, false>

Functions

std::unique_ptr<::mlir::Passmlir::impl::createMem2Reg ()
std::unique_ptr<::mlir::Passmlir::impl::createMem2Reg (Mem2RegOptions options)
std::unique_ptr<::mlir::Passmlir::createMem2Reg ()
std::unique_ptr<::mlir::Passmlir::createMem2Reg (Mem2RegOptions options)
static const DenseMap< Block *, size_t > & getOrCreateBlockIndices (BlockIndexCache &blockIndexCache, Region *region)
 Gets or creates a block index mapping for region.
static void dominanceSort (SmallVector< Operation * > &ops, Region &region, BlockIndexCache &blockIndexCache)
 Sorts ops according to dominance.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mem2reg"

Definition at line 30 of file Mem2Reg.cpp.

◆ GEN_PASS_DEF_MEM2REG

#define GEN_PASS_DEF_MEM2REG

Definition at line 26 of file Mem2Reg.cpp.

Typedef Documentation

◆ IDFCalculator

using IDFCalculator = llvm::IDFCalculatorBase<Block, false>

Definition at line 390 of file Mem2Reg.cpp.

Function Documentation

◆ dominanceSort()

void dominanceSort ( SmallVector< Operation * > & ops,
Region & region,
BlockIndexCache & blockIndexCache )
static

Sorts ops according to dominance.

Relies on the topological order of basic blocks to get a deterministic ordering. Uses blockIndexCache to avoid the potentially expensive recomputation of a block index map.

Definition at line 543 of file Mem2Reg.cpp.

References getOrCreateBlockIndices(), lhs, and rhs.

◆ getOrCreateBlockIndices()

const DenseMap< Block *, size_t > & getOrCreateBlockIndices ( BlockIndexCache & blockIndexCache,
Region * region )
static

Gets or creates a block index mapping for region.

Definition at line 528 of file Mem2Reg.cpp.

References mlir::getBlocksSortedByDominance(), and inserted().

Referenced by dominanceSort().