LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
SpecializedMemoryPasses.h File Reference

Provides SpecializedSROA<AllocOpTy> and SpecializedMem2Reg<AllocOpTy>: pass templates that replicate the bodies of the MLIR sroa and mem2reg passes but restrict the allocation-op walk to a single concrete op type rather than collecting every op that implements the corresponding allocation interface. More...

#include "llzk/Dialect/LLZK/IR/Dialect.h"
#include "llzk/Dialect/LLZK/IR/Ops.h"
#include "llzk/Util/Walk.h"
#include <mlir/Analysis/DataLayoutAnalysis.h>
#include <mlir/Dialect/SCF/IR/SCF.h>
#include <mlir/Dialect/UB/IR/UBOps.h>
#include <mlir/IR/Dominance.h>
#include <mlir/Interfaces/MemorySlotInterfaces.h>
#include <mlir/Pass/Pass.h>
#include <mlir/Pass/PassManager.h>
#include <mlir/Transforms/Mem2Reg.h>
#include <mlir/Transforms/Passes.h>
#include <mlir/Transforms/SROA.h>
#include <llvm/ADT/StringRef.h>
#include <memory>
Include dependency graph for SpecializedMemoryPasses.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  llzk::SpecializedSROA< AllocOpTy >
 A variant of the MLIR sroa pass that only destructures memory slots belonging to allocators of type AllocOpTy (which must implement mlir::DestructurableAllocationOpInterface). More...
struct  llzk::SpecializedMem2Reg< AllocOpTy >
 A variant of the MLIR mem2reg pass that only promotes memory slots belonging to allocators of type AllocOpTy (which must implement mlir::PromotableAllocationOpInterface). More...
class  llzk::detail::RemoveDeadValuesWorkaroundPass
 A workaround wrapper around MLIR's remove-dead-values pass that normalizes empty scf.if else regions before running the upstream implementation, cleans up the trivial regions afterwards, and removes unused ub.poison values left by an earlier invocation. More...

Namespaces

namespace  llzk
namespace  llzk::detail
 Provides the necessary information to the RemoveUnusedDiscardableAllocations pass about operations that load or store values from the result of an allocator op marked with the MemAlloc<DiscardableAllocationResource> memory effect so unused allocators and stores can be removed.

Functions

template<typename AllocOpTy>
std::unique_ptr< SpecializedSROA< AllocOpTy > > llzk::createSpecializedSROAPass ()
template<typename AllocOpTy>
std::unique_ptr< SpecializedMem2Reg< AllocOpTy > > llzk::createSpecializedMem2RegPass ()
std::unique_ptr< mlir::Pass > llzk::createRemoveDeadValuesWorkaroundPass ()

Detailed Description

Provides SpecializedSROA<AllocOpTy> and SpecializedMem2Reg<AllocOpTy>: pass templates that replicate the bodies of the MLIR sroa and mem2reg passes but restrict the allocation-op walk to a single concrete op type rather than collecting every op that implements the corresponding allocation interface.

Definition in file SpecializedMemoryPasses.h.