MLIR: lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "llvm-inliner"
Functions
static bool hasLifetimeMarkers (LLVM::AllocaOp allocaOp)
Check whether the given alloca is an input to a lifetime intrinsic, optionally passing through one or more casts on the way.
static void handleInlinedAllocas (Operation *call, iterator_range< Region::iterator > inlinedBlocks)
Handles alloca operations in the inlined blocks:
static void deepCloneAliasScopes (iterator_range< Region::iterator > inlinedBlocks)
Maps all alias scopes in the inlined operations to deep clones of the scopes and domain.
static ArrayAttr concatArrayAttr (ArrayAttr lhs, ArrayAttr rhs)
Creates a new ArrayAttr by concatenating lhs with rhs.
static FailureOr< SmallVector< Value > > getUnderlyingObjectSet (Value pointerValue)
Attempts to return the set of all underlying pointer values that pointerValue is based on.
static void createNewAliasScopesFromNoAliasParameter (Operation *call, iterator_range< Region::iterator > inlinedBlocks)
Creates a new AliasScopeAttr for every noalias parameter and attaches it to the appropriate inlined memory operations in an attempt to preserve the original semantics of the parameter attribute.
static void appendCallOpAliasScopes (Operation *call, iterator_range< Region::iterator > inlinedBlocks)
Appends any alias scopes of the call operation to any inlined memory operation.
static void handleAliasScopes (Operation *call, iterator_range< Region::iterator > inlinedBlocks)
Handles all interactions with alias scopes during inlining.
static void handleAccessGroups (Operation *call, iterator_range< Region::iterator > inlinedBlocks)
Appends any access groups of the call operation to any inlined memory operation.
static void handleLoopAnnotations (Operation *call, iterator_range< Region::iterator > inlinedBlocks)
Updates locations inside loop annotations to reflect that they were inlined.
static uint64_t tryToEnforceAllocaAlignment (LLVM::AllocaOp alloca, uint64_t requestedAlignment, DataLayout const &dataLayout)
If requestedAlignment is higher than the alignment specified on alloca, realigns alloca if this does not exceed the natural stack alignment.
static uint64_t tryToEnforceAlignment (Value value, uint64_t requestedAlignment, DataLayout const &dataLayout)
Tries to find and return the alignment of the pointer value by looking for an alignment attribute on the defining allocation op or function argument.
static Value handleByValArgumentInit (OpBuilder &builder, Location loc, Value argument, Type elementType, uint64_t elementTypeSize, uint64_t targetAlignment)
Introduces a new alloca and copies the memory pointed to by argument to the address of the new alloca, then returns the value of the new alloca.
static Value handleByValArgument (OpBuilder &builder, Operation *callable, Value argument, Type elementType, uint64_t requestedAlignment)
Handles a function argument marked with the byval attribute by introducing a memcpy or realigning the defining operation, if required either due to the pointee being writeable in the callee, and/or due to an alignment mismatch.

DEBUG_TYPE

#define DEBUG_TYPE "llvm-inliner"

appendCallOpAliasScopes()

concatArrayAttr()

createNewAliasScopesFromNoAliasParameter()

deepCloneAliasScopes()

getUnderlyingObjectSet()

handleAccessGroups()

handleAliasScopes()

handleByValArgument()

handleByValArgumentInit()

Value handleByValArgumentInit ( OpBuilder & builder, Location loc, Value argument, Type elementType, uint64_t elementTypeSize, uint64_t targetAlignment ) static

handleInlinedAllocas()

Handles alloca operations in the inlined blocks:

Definition at line 56 of file InlinerInterfaceImpl.cpp.

References mlir::Block::begin(), mlir::Region::front(), mlir::Operation::getContext(), mlir::Operation::getLoc(), mlir::Block::getOps(), mlir::Operation::getParentOp(), mlir::Operation::getParentRegion(), mlir::Builder::getType(), hasLifetimeMarkers(), mlir::m_Constant(), mlir::matchPattern(), mlir::OpBuilder::setInsertionPoint(), and mlir::OpBuilder::setInsertionPointToStart().

handleLoopAnnotations()

hasLifetimeMarkers()

bool hasLifetimeMarkers ( LLVM::AllocaOp allocaOp) static

tryToEnforceAlignment()

uint64_t tryToEnforceAlignment ( Value value, uint64_t requestedAlignment, DataLayout const & dataLayout ) static

tryToEnforceAllocaAlignment()

uint64_t tryToEnforceAllocaAlignment ( LLVM::AllocaOp alloca, uint64_t requestedAlignment, DataLayout const & dataLayout ) static