MLIR  19.0.0git
Functions
RegionUtils.cpp File Reference
#include "mlir/Transforms/RegionUtils.h"
#include "mlir/IR/Block.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/RegionGraphTraits.h"
#include "mlir/IR/Value.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Transforms/TopologicalSortUtils.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallSet.h"
#include <deque>

Go to the source code of this file.

Functions

static bool isUseSpeciallyKnownDead (OpOperand &use, LiveMap &liveMap)
 
static void processValue (Value value, LiveMap &liveMap)
 
static void propagateLiveness (Region &region, LiveMap &liveMap)
 
static void propagateTerminatorLiveness (Operation *op, LiveMap &liveMap)
 
static void propagateLiveness (Operation *op, LiveMap &liveMap)
 
static void eraseTerminatorSuccessorOperands (Operation *terminator, LiveMap &liveMap)
 
static LogicalResult deleteDeadness (RewriterBase &rewriter, MutableArrayRef< Region > regions, LiveMap &liveMap)
 
static bool ableToUpdatePredOperands (Block *block)
 Returns true if the predecessor terminators of the given block can not have their operands updated. More...
 
static LogicalResult mergeIdenticalBlocks (RewriterBase &rewriter, Region &region)
 Identify identical blocks within the given region and merge them, inserting new block arguments as necessary. More...
 
static LogicalResult mergeIdenticalBlocks (RewriterBase &rewriter, MutableArrayRef< Region > regions)
 Identify identical blocks within the given regions and merge them, inserting new block arguments as necessary. More...
 

Function Documentation

◆ ableToUpdatePredOperands()

static bool ableToUpdatePredOperands ( Block block)
static

Returns true if the predecessor terminators of the given block can not have their operands updated.

Definition at line 670 of file RegionUtils.cpp.

References mlir::Block::pred_begin(), and mlir::Block::pred_end().

◆ deleteDeadness()

static LogicalResult deleteDeadness ( RewriterBase rewriter,
MutableArrayRef< Region regions,
LiveMap &  liveMap 
)
static

◆ eraseTerminatorSuccessorOperands()

static void eraseTerminatorSuccessorOperands ( Operation terminator,
LiveMap &  liveMap 
)
static

◆ isUseSpeciallyKnownDead()

static bool isUseSpeciallyKnownDead ( OpOperand use,
LiveMap &  liveMap 
)
static

◆ mergeIdenticalBlocks() [1/2]

static LogicalResult mergeIdenticalBlocks ( RewriterBase rewriter,
MutableArrayRef< Region regions 
)
static

Identify identical blocks within the given regions and merge them, inserting new block arguments as necessary.

Definition at line 799 of file RegionUtils.cpp.

References mergeIdenticalBlocks(), and mlir::succeeded().

◆ mergeIdenticalBlocks() [2/2]

static LogicalResult mergeIdenticalBlocks ( RewriterBase rewriter,
Region region 
)
static

Identify identical blocks within the given region and merge them, inserting new block arguments as necessary.

Returns success if any blocks were merged, failure otherwise.

Definition at line 752 of file RegionUtils.cpp.

References mlir::Region::empty(), mlir::failure(), and mlir::Block::getSuccessors().

Referenced by mergeIdenticalBlocks(), and mlir::simplifyRegions().

◆ processValue()

static void processValue ( Value  value,
LiveMap &  liveMap 
)
static

Definition at line 301 of file RegionUtils.cpp.

References mlir::Value::getUses().

◆ propagateLiveness() [1/2]

static void propagateLiveness ( Operation op,
LiveMap &  liveMap 
)
static

Definition at line 337 of file RegionUtils.cpp.

◆ propagateLiveness() [2/2]

static void propagateLiveness ( Region region,
LiveMap &  liveMap 
)
static

Definition at line 359 of file RegionUtils.cpp.

References mlir::Region::empty(), and mlir::Region::front().

Referenced by mlir::runRegionDCE().

◆ propagateTerminatorLiveness()

static void propagateTerminatorLiveness ( Operation op,
LiveMap &  liveMap 
)
static

Definition at line 313 of file RegionUtils.cpp.