MLIR
20.0.0git
|
#include "mlir/Transforms/InliningUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/IR/Operation.h"
#include "mlir/Interfaces/CallInterfaces.h"
#include "llvm/ADT/MapVector.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 "inlining" |
Functions | |
static void | remapInlinedLocations (iterator_range< Region::iterator > inlinedBlocks, Location callerLoc) |
Remap all locations reachable from the inlined blocks with CallSiteLoc locations with the provided caller location. More... | |
static void | remapInlinedOperands (iterator_range< Region::iterator > inlinedBlocks, IRMapping &mapper) |
static bool | isLegalToInline (InlinerInterface &interface, Region *src, Region *insertRegion, bool shouldCloneInlinedRegion, IRMapping &valueMapping) |
Utility to check that all of the operations within 'src' can be inlined. More... | |
static void | handleArgumentImpl (InlinerInterface &interface, OpBuilder &builder, CallOpInterface call, CallableOpInterface callable, IRMapping &mapper) |
static void | handleResultImpl (InlinerInterface &interface, OpBuilder &builder, CallOpInterface call, CallableOpInterface callable, ValueRange results) |
static LogicalResult | inlineRegionImpl (InlinerInterface &interface, Region *src, Block *inlineBlock, Block::iterator inlinePoint, IRMapping &mapper, ValueRange resultsToReplace, TypeRange regionResultTypes, std::optional< Location > inlineLoc, bool shouldCloneInlinedRegion, CallOpInterface call={}) |
static LogicalResult | inlineRegionImpl (InlinerInterface &interface, Region *src, Block *inlineBlock, Block::iterator inlinePoint, ValueRange inlinedOperands, ValueRange resultsToReplace, std::optional< Location > inlineLoc, bool shouldCloneInlinedRegion, CallOpInterface call={}) |
static Value | materializeConversion (const DialectInlinerInterface *interface, SmallVectorImpl< Operation * > &castOps, OpBuilder &castBuilder, Value arg, Type type, Location conversionLoc) |
Utility function used to generate a cast operation from the given interface, or return nullptr if a cast could not be generated. More... | |
#define DEBUG_TYPE "inlining" |
Definition at line 24 of file InliningUtils.cpp.
|
static |
Definition at line 176 of file InliningUtils.cpp.
References mlir::detail::enumerate(), mlir::Builder::getDictionaryAttr(), mlir::Value::getType(), mlir::InlinerInterface::handleArgument(), mlir::IRMapping::lookup(), and mlir::IRMapping::map().
|
static |
Definition at line 203 of file InliningUtils.cpp.
References mlir::detail::enumerate(), mlir::Builder::getDictionaryAttr(), mlir::detail::IROperandBase::getOwner(), mlir::Value::getType(), mlir::Operation::getUsers(), and mlir::InlinerInterface::handleResult().
|
static |
Handle the terminators for each of the new blocks.
Definition at line 236 of file InliningUtils.cpp.
Referenced by mlir::inlineCall(), and mlir::inlineRegion().
|
static |
Definition at line 342 of file InliningUtils.cpp.
|
static |
Utility to check that all of the operations within 'src' can be inlined.
Definition at line 146 of file InliningUtils.cpp.
References mlir::InlinerInterface::isLegalToInline(), and mlir::InlinerInterface::shouldAnalyzeRecursively().
|
static |
Utility function used to generate a cast operation from the given interface, or return nullptr if a cast could not be generated.
Definition at line 417 of file InliningUtils.cpp.
References mlir::Operation::getNumOperands(), mlir::Operation::getNumResults(), mlir::Operation::getOperand(), mlir::Operation::getResult(), mlir::DialectInlinerInterface::materializeCallConversion(), and mlir::Operation::result_type_begin().
Referenced by mlir::inlineCall().
|
static |
Remap all locations reachable from the inlined blocks with CallSiteLoc locations with the provided caller location.
Definition at line 31 of file InliningUtils.cpp.
References mlir::detail::AttrTypeReplacerBase< Concrete >::addReplacement(), mlir::get(), mlir::detail::AttrTypeReplacerBase< Concrete >::recursivelyReplaceElementsIn(), and mlir::WalkResult::skip().
|
static |
Definition at line 61 of file InliningUtils.cpp.
References mlir::IRMapping::lookupOrNull().