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

#include <LoadChainSeparation.hpp>

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

Classes

class  Context
 
struct  ModRefChain
 
struct  ModRefChainLink
 
struct  ModRefChainSummary
 

Public Member Functions

 ~LoadChainSeparation () noexcept override
 
 LoadChainSeparation ()
 
 LoadChainSeparation (const LoadChainSeparation &)=delete
 
LoadChainSeparationoperator= (const LoadChainSeparation &)=delete
 
void Run (rvsdg::RvsdgModule &module, 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 separateReferenceChainsInRegion (rvsdg::Region &region)
 
void separateReferenceChainsInLambda (rvsdg::LambdaNode &lambdaNode)
 
void separateRefenceChainsInTheta (rvsdg::ThetaNode &thetaNode, util::HashSet< rvsdg::Output * > &visitedOutputs)
 
void separateRefenceChainsInGamma (rvsdg::GammaNode &gammaNode)
 
bool separateReferenceChains (rvsdg::Output &startOutput, util::HashSet< rvsdg::Output * > &visitedOutputs)
 
void traceModRefChains (rvsdg::Output &startOutput, util::HashSet< rvsdg::Output * > &visitedOutputs, ModRefChainSummary &summary)
 

Static Private Member Functions

static std::vector< ModRefChainextractReferenceSubchains (const ModRefChain &modRefChain)
 
static rvsdg::InputmapMemoryStateOutputToInput (const rvsdg::Output &output)
 

Private Attributes

std::unique_ptr< ContextContext_ {}
 

Detailed Description

Separates chains of memory region references from each other by rendering them independent in the RVSDG through the insertion of a MemoryStateJoinOperation node.

The following example illustrates the transformation:

v1 s2 = LoadNonVolatileOperation a1 s1 v2 s3 = LoadNonVolatileOperation a2 s2

is transformed to:

v1 s2 = LoadNonVolatileOperation a1 s1 v2 s3 = LoadNonVolatileOperation a2 s1 s4 = MemoryStateJoinOperation s2 s3

Definition at line 36 of file LoadChainSeparation.hpp.

Constructor & Destructor Documentation

◆ ~LoadChainSeparation()

jlm::llvm::LoadChainSeparation::~LoadChainSeparation ( )
overridedefaultnoexcept

◆ LoadChainSeparation() [1/2]

jlm::llvm::LoadChainSeparation::LoadChainSeparation ( )

Definition at line 64 of file LoadChainSeparation.cpp.

◆ LoadChainSeparation() [2/2]

jlm::llvm::LoadChainSeparation::LoadChainSeparation ( const LoadChainSeparation )
delete

Member Function Documentation

◆ extractReferenceSubchains()

std::vector< LoadChainSeparation::ModRefChain > jlm::llvm::LoadChainSeparation::extractReferenceSubchains ( const ModRefChain modRefChain)
staticprivate

Extracts all reference subchains of mod/ref chain modRefChain. A valid reference subchain is defined as followed:

  1. Must only contain mod/ref chain links of type ModRefChainLink::Type::Reference
  2. Must have at least two links
Parameters
modRefChainThe mod/ref chain from which to extract the reference subchains
Returns
A vector of reference subchains.

Definition at line 250 of file LoadChainSeparation.cpp.

◆ mapMemoryStateOutputToInput()

rvsdg::Input & jlm::llvm::LoadChainSeparation::mapMemoryStateOutputToInput ( const rvsdg::Output output)
staticprivate

Maps a memory state output of a node to the respective memory state input.

Parameters
outputThe output that is mapped.
Returns
A memory state input, if the output can be mapped.

Definition at line 233 of file LoadChainSeparation.cpp.

◆ operator=()

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

◆ Run()

void jlm::llvm::LoadChainSeparation::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 69 of file LoadChainSeparation.cpp.

◆ separateRefenceChainsInGamma()

void jlm::llvm::LoadChainSeparation::separateRefenceChainsInGamma ( rvsdg::GammaNode gammaNode)
private

Definition at line 136 of file LoadChainSeparation.cpp.

◆ separateRefenceChainsInTheta()

void jlm::llvm::LoadChainSeparation::separateRefenceChainsInTheta ( rvsdg::ThetaNode thetaNode,
util::HashSet< rvsdg::Output * > &  visitedOutputs 
)
private

Definition at line 160 of file LoadChainSeparation.cpp.

◆ separateReferenceChains()

bool jlm::llvm::LoadChainSeparation::separateReferenceChains ( rvsdg::Output startOutput,
util::HashSet< rvsdg::Output * > &  visitedOutputs 
)
private

Separates the reference links of the mod/ref chain starting at memory state output startOutput.

Parameters
startOutputThe starting output of the mod/ref chain. Must be of type MemoryStateType.
visitedOutputsThe set of outputs that were already visited throughout the separation in the region.
Returns
True, if the separated mod/ref chains had a modifier link, otherwise False.

Definition at line 190 of file LoadChainSeparation.cpp.

◆ separateReferenceChainsInLambda()

void jlm::llvm::LoadChainSeparation::separateReferenceChainsInLambda ( rvsdg::LambdaNode lambdaNode)
private

Definition at line 126 of file LoadChainSeparation.cpp.

◆ separateReferenceChainsInRegion()

void jlm::llvm::LoadChainSeparation::separateReferenceChainsInRegion ( rvsdg::Region region)
private

Definition at line 77 of file LoadChainSeparation.cpp.

◆ traceModRefChains()

void jlm::llvm::LoadChainSeparation::traceModRefChains ( rvsdg::Output startOutput,
util::HashSet< rvsdg::Output * > &  visitedOutputs,
ModRefChainSummary summary 
)
private

Recursively traces from output startOutput upwards to find all mod/ref chains within a single region.

Parameters
startOutputThe starting output for the tracing. Must be of type MemoryStateType.
visitedOutputsThe set of outputs that were already visited throughout the recursive tracing.
summaryThe tracing summary.

Definition at line 284 of file LoadChainSeparation.cpp.

Member Data Documentation

◆ Context_

std::unique_ptr<Context> jlm::llvm::LoadChainSeparation::Context_ {}
private

Definition at line 179 of file LoadChainSeparation.hpp.


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