Jlm
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
jlm::llvm::NodeReduction Class Referencefinal

#include <reduction.hpp>

Inheritance diagram for jlm::llvm::NodeReduction:
Inheritance graph
[legend]
Collaboration diagram for jlm::llvm::NodeReduction:
Collaboration graph
[legend]

Classes

class  Statistics
 

Public Member Functions

 ~NodeReduction () noexcept override
 
 NodeReduction ()
 
 NodeReduction (const NodeReduction &)=delete
 
 NodeReduction (NodeReduction &&)=delete
 
NodeReductionoperator= (const NodeReduction &)=delete
 
NodeReductionoperator= (NodeReduction &&)=delete
 
void Run (rvsdg::RvsdgModule &rvsdgModule, util::StatisticsCollector &statisticsCollector) override
 Perform RVSDG transformation. More...
 
- Public Member Functions inherited from jlm::rvsdg::Transformation
virtual ~Transformation () noexcept
 
 Transformation (std::string_view Name)
 
const std::string_view & GetName () const noexcept
 
void Run (RvsdgModule &module)
 Perform RVSDG transformation. More...
 

Private Member Functions

void ReduceNodesInRegion (rvsdg::Region &region)
 
bool ReduceStructuralNode (rvsdg::StructuralNode &structuralNode)
 

Static Private Member Functions

static bool ReduceGammaNode (rvsdg::StructuralNode &gammaNode)
 
static bool ReduceSimpleNode (rvsdg::SimpleNode &simpleNode)
 
static bool ReduceLoadNode (rvsdg::SimpleNode &simpleNode)
 
static bool ReduceStoreNode (rvsdg::SimpleNode &simpleNode)
 
static bool ReduceMemoryStateMergeNode (rvsdg::SimpleNode &simpleNode)
 
static bool ReduceMemoryStateSplitNode (rvsdg::SimpleNode &simpleNode)
 
static bool ReduceLambdaExitMemoryStateMergeNode (rvsdg::SimpleNode &simpleNode)
 
static bool ReduceBinaryNode (rvsdg::SimpleNode &simpleNode)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeLoadNode (const LoadNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeStoreNode (const StoreNonVolatileOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeMemoryStateMergeNode (const MemoryStateMergeOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeMemoryStateJoinNode (const MemoryStateJoinOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeMemoryStateSplitNode (const MemoryStateSplitOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeCallExitMemoryStateSplitNode (const CallExitMemoryStateSplitOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeLambdaEntryMemoryStateSplitNode (const LambdaEntryMemoryStateSplitOperation &operation, const std::vector< rvsdg::Output * > &operands)
 
static std::optional< std::vector< rvsdg::Output * > > NormalizeLambdaExitMemoryStateMergeNode (const LambdaExitMemoryStateMergeOperation &operation, const std::vector< rvsdg::Output * > &operands)
 

Private Attributes

std::unique_ptr< StatisticsStatistics_
 

Detailed Description

The node reduction transformation performs a series of peephole optimizations in the RVSDG. The nodes in a region are visited top-down and reductions are performed until a fix-point is reached, i.e., until no peephole optimization can be applied any longer to any node in a region.

Definition at line 41 of file reduction.hpp.

Constructor & Destructor Documentation

◆ ~NodeReduction()

jlm::llvm::NodeReduction::~NodeReduction ( )
overridedefaultnoexcept

◆ NodeReduction() [1/3]

jlm::llvm::NodeReduction::NodeReduction ( )

Definition at line 54 of file reduction.cpp.

◆ NodeReduction() [2/3]

jlm::llvm::NodeReduction::NodeReduction ( const NodeReduction )
delete

◆ NodeReduction() [3/3]

jlm::llvm::NodeReduction::NodeReduction ( NodeReduction &&  )
delete

Member Function Documentation

◆ NormalizeCallExitMemoryStateSplitNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeCallExitMemoryStateSplitNode ( const CallExitMemoryStateSplitOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 326 of file reduction.cpp.

◆ NormalizeLambdaEntryMemoryStateSplitNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeLambdaEntryMemoryStateSplitNode ( const LambdaEntryMemoryStateSplitOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 340 of file reduction.cpp.

◆ NormalizeLambdaExitMemoryStateMergeNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeLambdaExitMemoryStateMergeNode ( const LambdaExitMemoryStateMergeOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 354 of file reduction.cpp.

◆ NormalizeLoadNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeLoadNode ( const LoadNonVolatileOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 250 of file reduction.cpp.

◆ NormalizeMemoryStateJoinNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeMemoryStateJoinNode ( const MemoryStateJoinOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 301 of file reduction.cpp.

◆ NormalizeMemoryStateMergeNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeMemoryStateMergeNode ( const MemoryStateMergeOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 287 of file reduction.cpp.

◆ NormalizeMemoryStateSplitNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeMemoryStateSplitNode ( const MemoryStateSplitOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 313 of file reduction.cpp.

◆ NormalizeStoreNode()

std::optional< std::vector< rvsdg::Output * > > jlm::llvm::NodeReduction::NormalizeStoreNode ( const StoreNonVolatileOperation operation,
const std::vector< rvsdg::Output * > &  operands 
)
staticprivate

Definition at line 268 of file reduction.cpp.

◆ operator=() [1/2]

NodeReduction& jlm::llvm::NodeReduction::operator= ( const NodeReduction )
delete

◆ operator=() [2/2]

NodeReduction& jlm::llvm::NodeReduction::operator= ( NodeReduction &&  )
delete

◆ ReduceBinaryNode()

bool jlm::llvm::NodeReduction::ReduceBinaryNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 217 of file reduction.cpp.

◆ ReduceGammaNode()

bool jlm::llvm::NodeReduction::ReduceGammaNode ( rvsdg::StructuralNode gammaNode)
staticprivate

Definition at line 137 of file reduction.cpp.

◆ ReduceLambdaExitMemoryStateMergeNode()

bool jlm::llvm::NodeReduction::ReduceLambdaExitMemoryStateMergeNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 241 of file reduction.cpp.

◆ ReduceLoadNode()

bool jlm::llvm::NodeReduction::ReduceLoadNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 201 of file reduction.cpp.

◆ ReduceMemoryStateMergeNode()

bool jlm::llvm::NodeReduction::ReduceMemoryStateMergeNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 225 of file reduction.cpp.

◆ ReduceMemoryStateSplitNode()

bool jlm::llvm::NodeReduction::ReduceMemoryStateSplitNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 233 of file reduction.cpp.

◆ ReduceNodesInRegion()

void jlm::llvm::NodeReduction::ReduceNodesInRegion ( rvsdg::Region region)
private

Definition at line 75 of file reduction.cpp.

◆ ReduceSimpleNode()

bool jlm::llvm::NodeReduction::ReduceSimpleNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 148 of file reduction.cpp.

◆ ReduceStoreNode()

bool jlm::llvm::NodeReduction::ReduceStoreNode ( rvsdg::SimpleNode simpleNode)
staticprivate

Definition at line 209 of file reduction.cpp.

◆ ReduceStructuralNode()

bool jlm::llvm::NodeReduction::ReduceStructuralNode ( rvsdg::StructuralNode structuralNode)
private

Reduces the structural node structuralNode.

Note
This method only returns true if the node itself could be reduced, but not if any of the nodes in its subregions could be reduced.
Parameters
structuralNodeThe structural node that is supposed to be reduced.
Returns
True, if the structural node could be reduced, otherwise false.

Definition at line 110 of file reduction.cpp.

◆ Run()

void jlm::llvm::NodeReduction::Run ( rvsdg::RvsdgModule module,
util::StatisticsCollector statisticsCollector 
)
overridevirtual

Perform RVSDG transformation.

Note
This method is expected to be called multiple times. An implementation is required to reset the objects' internal state to ensure correct behavior after every invocation.
Parameters
moduleRVSDG module the transformation is performed on.
statisticsCollectorStatistics collector for collecting transformation statistics.

Implements jlm::rvsdg::Transformation.

Definition at line 59 of file reduction.cpp.

Member Data Documentation

◆ Statistics_

std::unique_ptr<Statistics> jlm::llvm::NodeReduction::Statistics_
private

Definition at line 143 of file reduction.hpp.


The documentation for this class was generated from the following files: