MLIR
18.0.0git
|
#include "mlir/Transforms/SROA.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Interfaces/MemorySlotInterfaces.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Transforms/Passes.h"
#include "mlir/Transforms/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
mlir | |
Include the generated interface declarations. | |
Macros | |
#define | GEN_PASS_DEF_SROA |
#define | DEBUG_TYPE "sroa" |
Functions | |
static std::optional< MemorySlotDestructuringInfo > | computeDestructuringInfo (DestructurableMemorySlot &slot) |
Computes information for slot destructuring. More... | |
static void | destructureSlot (DestructurableMemorySlot &slot, DestructurableAllocationOpInterface allocator, RewriterBase &rewriter, MemorySlotDestructuringInfo &info, const SROAStatistics &statistics) |
Performs the destructuring of a destructible slot given associated destructuring information. More... | |
|
static |
Computes information for slot destructuring.
This will compute whether this slot can be destructured and data to perform the destructuring. Returns nothing if the slot cannot be destructured or if there is no useful work to be done.
Definition at line 46 of file SROA.cpp.
References mlir::MemorySlot::elemType, mlir::getForwardSlice(), mlir::Value::getUses(), mlir::MemorySlot::ptr, mlir::succeeded(), and mlir::Value::use_empty().
Referenced by mlir::tryToDestructureMemorySlots().
|
static |
Performs the destructuring of a destructible slot given associated destructuring information.
The provided slot will be destructured in subslots as specified by its allocator.
Definition at line 133 of file SROA.cpp.
References mlir::Delete, mlir::SROAStatistics::destructuredAmount, mlir::DestructurableMemorySlot::elementPtrs, mlir::RewriterBase::eraseOp(), mlir::Value::getParentBlock(), mlir::SROAStatistics::maxSubelementAmount, mlir::MemorySlot::ptr, mlir::OpBuilder::setInsertionPointAfter(), mlir::OpBuilder::setInsertionPointToStart(), mlir::SROAStatistics::slotsWithMemoryBenefit, mlir::topologicalSort(), and mlir::Value::use_empty().
Referenced by mlir::tryToDestructureMemorySlots().