MLIR  21.0.0git
Functions
EraseUnusedOperandsAndResults.cpp File Reference
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/Dialect/Linalg/IR/Linalg.h"

Go to the source code of this file.

Functions

static bool isResultValueDead (linalg::GenericOp genericOp, OpResult result)
 Return true if the result of an operation genericOp is dead. More...
 
static llvm::SmallDenseMap< unsigned, unsigned > deduplicateInputOperands (GenericOp genericOp, SmallVector< OpOperand * > &droppedOpOperands, SmallVector< Value > &newInputOperands, SmallVector< AffineMap > &newIndexingMaps)
 
static llvm::SmallDenseMap< unsigned, unsigned > deduplicateOutputOperands (GenericOp genericOp, SmallVector< OpOperand * > &droppedOpOperands, SmallVector< Value > &newOutputOperands, SmallVector< AffineMap > &newIndexingMaps, bool removeOutputs)
 
static void populateOpPayload (GenericOp genericOp, GenericOp newOp, const llvm::SmallDenseMap< unsigned, unsigned > &origInsToNewInsPos, const llvm::SmallDenseMap< unsigned, unsigned > &origOutsToNewOutsPos, RewriterBase &rewriter)
 

Function Documentation

◆ deduplicateInputOperands()

static llvm::SmallDenseMap<unsigned, unsigned> deduplicateInputOperands ( GenericOp  genericOp,
SmallVector< OpOperand * > &  droppedOpOperands,
SmallVector< Value > &  newInputOperands,
SmallVector< AffineMap > &  newIndexingMaps 
)
static

◆ deduplicateOutputOperands()

static llvm::SmallDenseMap<unsigned, unsigned> deduplicateOutputOperands ( GenericOp  genericOp,
SmallVector< OpOperand * > &  droppedOpOperands,
SmallVector< Value > &  newOutputOperands,
SmallVector< AffineMap > &  newIndexingMaps,
bool  removeOutputs 
)
static

◆ isResultValueDead()

static bool isResultValueDead ( linalg::GenericOp  genericOp,
OpResult  result 
)
static

Return true if the result of an operation genericOp is dead.

Definition at line 17 of file EraseUnusedOperandsAndResults.cpp.

References mlir::OpResult::getResultNumber(), mlir::Value::hasOneUse(), mlir::Operation::use_empty(), mlir::Value::use_empty(), and mlir::Value::user_begin().

Referenced by deduplicateOutputOperands().

◆ populateOpPayload()

static void populateOpPayload ( GenericOp  genericOp,
GenericOp  newOp,
const llvm::SmallDenseMap< unsigned, unsigned > &  origInsToNewInsPos,
const llvm::SmallDenseMap< unsigned, unsigned > &  origOutsToNewOutsPos,
RewriterBase rewriter 
)
static