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

Node Hoisting Transformation. More...

#include <push.hpp>

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

Classes

class  Context
 
class  Statistics
 

Public Member Functions

 ~NodeHoisting () noexcept override
 
 NodeHoisting ()
 
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 hoistNodesInRootRegion (rvsdg::Region &region)
 
void hoistNodesInLambda (rvsdg::LambdaNode &lambdaNode)
 
void markNodes (const rvsdg::Region &region)
 
void hoistNodes (rvsdg::Region &region)
 
void copyNodeToTargetRegion (rvsdg::Node &node) const
 
size_t computeRegionDepth (const rvsdg::Region &region) const
 
rvsdg::RegioncomputeTargetRegion (const rvsdg::Node &node) const
 
rvsdg::RegioncomputeTargetRegion (const rvsdg::Output &output) const
 

Static Private Member Functions

static std::vector< rvsdg::Output * > getOperandsFromTargetRegion (rvsdg::Node &node, rvsdg::Region &targetRegion)
 
static rvsdg::OutputgetOperandFromTargetRegion (rvsdg::Output &output, rvsdg::Region &targetRegion)
 
static bool isInvariantMemoryStateLoopVar (const rvsdg::ThetaNode::LoopVar &loopVar)
 

Private Attributes

std::unique_ptr< Contextcontext_ {}
 

Detailed Description

Node Hoisting Transformation.

This transformation hoists nodes out of gamma and theta nodes as far up the region tree as possible. It accomplishes this in two phases:

  1. Mark phase: This phase annotates each node with its target region, i.e., the final region in the region tree where it is legally allowed to hoist a node. The algorithm inspects each node's predecessors and their target regions to compute a node's target region.
  2. Hoist phase: This phase uses the information computed in the mark phase to hoist the nodes to their target region.

These two phases are performed on every function in the module.

Definition at line 36 of file push.hpp.

Constructor & Destructor Documentation

◆ ~NodeHoisting()

jlm::llvm::NodeHoisting::~NodeHoisting ( )
overridedefaultnoexcept

◆ NodeHoisting()

jlm::llvm::NodeHoisting::NodeHoisting ( )

Definition at line 105 of file push.cpp.

Member Function Documentation

◆ computeRegionDepth()

size_t jlm::llvm::NodeHoisting::computeRegionDepth ( const rvsdg::Region region) const
private

Definition at line 110 of file push.cpp.

◆ computeTargetRegion() [1/2]

rvsdg::Region & jlm::llvm::NodeHoisting::computeTargetRegion ( const rvsdg::Node node) const
private

Definition at line 207 of file push.cpp.

◆ computeTargetRegion() [2/2]

rvsdg::Region & jlm::llvm::NodeHoisting::computeTargetRegion ( const rvsdg::Output output) const
private

Definition at line 140 of file push.cpp.

◆ copyNodeToTargetRegion()

void jlm::llvm::NodeHoisting::copyNodeToTargetRegion ( rvsdg::Node node) const
private

Definition at line 318 of file push.cpp.

◆ getOperandFromTargetRegion()

rvsdg::Output & jlm::llvm::NodeHoisting::getOperandFromTargetRegion ( rvsdg::Output output,
rvsdg::Region targetRegion 
)
staticprivate

Definition at line 278 of file push.cpp.

◆ getOperandsFromTargetRegion()

std::vector< rvsdg::Output * > jlm::llvm::NodeHoisting::getOperandsFromTargetRegion ( rvsdg::Node node,
rvsdg::Region targetRegion 
)
staticprivate

Definition at line 305 of file push.cpp.

◆ hoistNodes()

void jlm::llvm::NodeHoisting::hoistNodes ( rvsdg::Region region)
private

Definition at line 344 of file push.cpp.

◆ hoistNodesInLambda()

void jlm::llvm::NodeHoisting::hoistNodesInLambda ( rvsdg::LambdaNode lambdaNode)
private

Definition at line 370 of file push.cpp.

◆ hoistNodesInRootRegion()

void jlm::llvm::NodeHoisting::hoistNodesInRootRegion ( rvsdg::Region region)
private

Definition at line 381 of file push.cpp.

◆ isInvariantMemoryStateLoopVar()

bool jlm::llvm::NodeHoisting::isInvariantMemoryStateLoopVar ( const rvsdg::ThetaNode::LoopVar loopVar)
staticprivate

Definition at line 122 of file push.cpp.

◆ markNodes()

void jlm::llvm::NodeHoisting::markNodes ( const rvsdg::Region region)
private

Definition at line 245 of file push.cpp.

◆ Run()

void jlm::llvm::NodeHoisting::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 411 of file push.cpp.

Member Data Documentation

◆ context_

std::unique_ptr<Context> jlm::llvm::NodeHoisting::context_ {}
private

Definition at line 84 of file push.hpp.


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