#include "mlir/Transforms/SROA.h"
#include "mlir/Analysis/DataLayoutAnalysis.h"
#include "mlir/Analysis/SliceAnalysis.h"
#include "mlir/Analysis/TopologicalSortUtils.h"
#include "mlir/Interfaces/MemorySlotInterfaces.h"
#include "mlir/Transforms/Passes.h"
namespace mlir {
#define GEN_PASS_DEF_SROA
#include "mlir/Transforms/Passes.h.inc"
}
#define DEBUG_TYPE …
usingnamespacemlir;
namespace {
struct MemorySlotDestructuringInfo { … };
}
static std::optional<MemorySlotDestructuringInfo>
computeDestructuringInfo(DestructurableMemorySlot &slot,
const DataLayout &dataLayout) { … }
static void destructureSlot(
DestructurableMemorySlot &slot,
DestructurableAllocationOpInterface allocator, OpBuilder &builder,
const DataLayout &dataLayout, MemorySlotDestructuringInfo &info,
SmallVectorImpl<DestructurableAllocationOpInterface> &newAllocators,
const SROAStatistics &statistics) { … }
LogicalResult mlir::tryToDestructureMemorySlots(
ArrayRef<DestructurableAllocationOpInterface> allocators,
OpBuilder &builder, const DataLayout &dataLayout,
SROAStatistics statistics) { … }
namespace {
struct SROA : public impl::SROABase<SROA> { … };
}