MLIR 22.0.0git
SROA.cpp File Reference
#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"
#include "llvm/Support/DebugLog.h"
#include "mlir/Transforms/Passes.h.inc"

Go to the source code of this file.

Classes

class  mlir::impl::SROABase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::impl
 Attribute collections provide a dictionary-like interface.

Macros

#define GEN_PASS_DEF_SROA
#define DEBUG_TYPE   "sroa"

Functions

std::unique_ptr<::mlir::Passmlir::impl::createSROA ()
std::unique_ptr<::mlir::Passmlir::createSROA ()
static std::optional< MemorySlotDestructuringInfo > computeDestructuringInfo (DestructurableMemorySlot &slot, const DataLayout &dataLayout)
 Computes information for slot destructuring.
static void destructureSlot (DestructurableMemorySlot &slot, DestructurableAllocationOpInterface allocator, OpBuilder &builder, const DataLayout &dataLayout, MemorySlotDestructuringInfo &info, SmallVectorImpl< DestructurableAllocationOpInterface > &newAllocators, const SROAStatistics &statistics)
 Performs the destructuring of a destructible slot given associated destructuring information.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "sroa"

Definition at line 22 of file SROA.cpp.

◆ GEN_PASS_DEF_SROA

#define GEN_PASS_DEF_SROA

Definition at line 18 of file SROA.cpp.

Function Documentation

◆ computeDestructuringInfo()

std::optional< MemorySlotDestructuringInfo > computeDestructuringInfo ( DestructurableMemorySlot & slot,
const DataLayout & dataLayout )
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 48 of file SROA.cpp.

References mlir::MemorySlot::elemType, mlir::getForwardSlice(), mlir::Value::getUses(), mlir::MemorySlot::ptr, and mlir::Value::use_empty().

Referenced by mlir::tryToDestructureMemorySlots().

◆ destructureSlot()

void destructureSlot ( DestructurableMemorySlot & slot,
DestructurableAllocationOpInterface allocator,
OpBuilder & builder,
const DataLayout & dataLayout,
MemorySlotDestructuringInfo & info,
SmallVectorImpl< DestructurableAllocationOpInterface > & newAllocators,
const SROAStatistics & statistics )
static