|
MLIR 24.0.0git
|
#include "mlir/Dialect/LLVMIR/LLVMMemoryIntrinsicOps.h"#include "IR/LLVMOps.h"#include "mlir/Dialect/LLVMIR/LLVMArithOps.h"#include "mlir/Dialect/LLVMIR/LLVMConstantOps.h"#include "mlir/Dialect/LLVMIR/LLVMConversionOps.h"#include "mlir/Dialect/LLVMIR/LLVMMemoryOps.h"#include "mlir/IR/Builders.h"#include "mlir/IR/DialectImplementation.h"#include "mlir/IR/Matchers.h"#include "mlir/Interfaces/DataLayoutInterfaces.h"#include "mlir/Interfaces/MemorySlotInterfaces.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/TypeSwitch.h"#include <optional>#include "mlir/Dialect/LLVMIR/LLVMMemoryIntrinsicOps.cpp.inc"Go to the source code of this file.
Macros | |
| #define | GET_OP_CLASSES |
Functions | |
| template<class MemIntr> | |
| static bool | definitelyWritesOnlyWithinSlot (MemIntr op, const MemorySlot &slot, const DataLayout &dataLayout) |
| Returns whether one can be sure the memory intrinsic does not write outside of the bounds of the given slot, on a best-effort basis. | |
| static bool | areAllIndicesI32 (const DestructurableMemorySlot &slot) |
| Checks whether all indices are i32. | |
| template<class MemsetIntr> | |
| static bool | memsetCanRewire (MemsetIntr op, const DestructurableMemorySlot &slot, SmallPtrSetImpl< Attribute > &usedIndices, SmallVectorImpl< MemorySlot > &mustBeSafelyUsed, const DataLayout &dataLayout) |
| template<class MemsetIntr> | |
| static Value | memsetGetStored (MemsetIntr op, const MemorySlot &slot, OpBuilder &builder) |
| template<class MemsetIntr> | |
| static bool | memsetCanUsesBeRemoved (MemsetIntr op, const MemorySlot &slot, const SmallPtrSetImpl< OpOperand * > &blockingUses, SmallVectorImpl< OpOperand * > &newBlockingUses, const DataLayout &dataLayout) |
| template<class MemsetIntr> | |
| static DeletionKind | memsetRewire (MemsetIntr op, const DestructurableMemorySlot &slot, DenseMap< Attribute, MemorySlot > &subslots, OpBuilder &builder, const DataLayout &dataLayout) |
| template<class MemcpyLike> | |
| static bool | memcpyLoadsFrom (MemcpyLike op, const MemorySlot &slot) |
| template<class MemcpyLike> | |
| static bool | memcpyStoresTo (MemcpyLike op, const MemorySlot &slot) |
| template<class MemcpyLike> | |
| static Value | memcpyGetStored (MemcpyLike op, const MemorySlot &slot, OpBuilder &builder) |
| template<class MemcpyLike> | |
| static bool | memcpyCanUsesBeRemoved (MemcpyLike op, const MemorySlot &slot, const SmallPtrSetImpl< OpOperand * > &blockingUses, SmallVectorImpl< OpOperand * > &newBlockingUses, const DataLayout &dataLayout) |
| template<class MemcpyLike> | |
| static DeletionKind | memcpyRemoveBlockingUses (MemcpyLike op, const MemorySlot &slot, const SmallPtrSetImpl< OpOperand * > &blockingUses, OpBuilder &builder, Value reachingDefinition) |
| template<class MemcpyLike> | |
| static LogicalResult | memcpyEnsureOnlySafeAccesses (MemcpyLike op, const MemorySlot &slot, SmallVectorImpl< MemorySlot > &mustBeSafelyUsed) |
| template<class MemcpyLike> | |
| static bool | memcpyCanRewire (MemcpyLike op, const DestructurableMemorySlot &slot, SmallPtrSetImpl< Attribute > &usedIndices, SmallVectorImpl< MemorySlot > &mustBeSafelyUsed, const DataLayout &dataLayout) |
| template<class MemcpyLike> | |
| static DeletionKind | memcpyRewire (MemcpyLike op, const DestructurableMemorySlot &slot, DenseMap< Attribute, MemorySlot > &subslots, OpBuilder &builder, const DataLayout &dataLayout) |
| Rewires a memcpy-like operation. | |
| #define GET_OP_CLASSES |
Definition at line 786 of file LLVMMemoryIntrinsicOps.cpp.
|
static |
Checks whether all indices are i32.
This is used to check GEPs can index into them.
Definition at line 208 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::Value::getContext(), mlir::MemorySlot::ptr, and mlir::DestructurableMemorySlot::subelementTypes.
Referenced by memcpyCanRewire(), and memsetCanRewire().
|
static |
Returns whether one can be sure the memory intrinsic does not write outside of the bounds of the given slot, on a best-effort basis.
Definition at line 196 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::Value::getType(), mlir::DataLayout::getTypeSize(), mlir::MemorySlot::ptr, and mlir::MemorySlot::valueType.
Referenced by memcpyEnsureOnlySafeAccesses(), and memsetCanRewire().
|
static |
Definition at line 512 of file LLVMMemoryIntrinsicOps.cpp.
References areAllIndicesI32(), mlir::DataLayout::getTypeSize(), mlir::MemorySlot::ptr, mlir::DestructurableMemorySlot::subelementTypes, and mlir::MemorySlot::valueType.
|
static |
Definition at line 473 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::DataLayout::getTypeSize(), and mlir::MemorySlot::valueType.
|
static |
Definition at line 502 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::DataLayout::closest(), definitelyWritesOnlyWithinSlot(), and success().
|
static |
Definition at line 465 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::MemorySlot::valueType.
|
static |
Definition at line 455 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::MemorySlot::ptr.
|
static |
Definition at line 491 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::Delete.
|
static |
Rewires a memcpy-like operation.
Only copies to or from the full slot are supported.
Definition at line 565 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::Delete, mlir::MemorySlot::ptr, mlir::DestructurableMemorySlot::subelementTypes, and mlir::MemorySlot::valueType.
|
static |
Definition at line 460 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::MemorySlot::ptr.
|
static |
Definition at line 222 of file LLVMMemoryIntrinsicOps.cpp.
References areAllIndicesI32(), definitelyWritesOnlyWithinSlot(), mlir::Type::getDialect(), and mlir::MemorySlot::valueType.
|
static |
Definition at line 298 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::DataLayout::getTypeSize(), and mlir::MemorySlot::valueType.
|
static |
Returns an integer value that is width bits wide representing the value assigned to the slot by memset.
Definition at line 243 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::m_Constant(), mlir::matchPattern(), and mlir::MemorySlot::valueType.
|
static |
Definition at line 319 of file LLVMMemoryIntrinsicOps.cpp.
References mlir::Delete, mlir::DataLayout::getTypeAllocSize(), mlir::DataLayout::getTypeSize(), and mlir::MemorySlot::valueType.