LLVM 24.0.0git
llvm::BlockFrequencyInfoImplBase::WorkingData Struct Reference

Index of loop information. More...

#include "llvm/Analysis/BlockFrequencyInfoImpl.h"

Public Member Functions

 WorkingData (const BlockNode &Node)
bool isLoopHeader () const
LoopDatagetContainingLoop () const
 The innermost loop containing Node that Node does not head.
BlockNode getResolvedNode () const
 Resolve a node to its representative.
LoopDatagetPackagedLoop () const
 The outermost loop containing Node that is currently packaged, if any.
BlockMassgetMass ()
 The mass slot for Node: its own, or that of the outermost packaged loop it heads.
bool isPackaged () const
 Has ContainingLoop been packaged up?
bool isAPackage () const
 Has Loop been packaged up?

Public Attributes

BlockNode Node
 This node.
LoopDataLoop = nullptr
 The loop this block is inside.
BlockMass Mass
 Mass distribution from the entry block.

Detailed Description

Index of loop information.

Definition at line 276 of file BlockFrequencyInfoImpl.h.

Constructor & Destructor Documentation

◆ WorkingData()

llvm::BlockFrequencyInfoImplBase::WorkingData::WorkingData ( const BlockNode & Node)
inline

Definition at line 281 of file BlockFrequencyInfoImpl.h.

References Node.

Member Function Documentation

◆ getContainingLoop()

LoopData * llvm::BlockFrequencyInfoImplBase::WorkingData::getContainingLoop ( ) const
inline

The innermost loop containing Node that Node does not head.

A block can head several nested loops: createIrreducibleLoop() reuses an SCC's entry blocks as the irreducible loop's headers.

Definition at line 289 of file BlockFrequencyInfoImpl.h.

References Loop, and Node.

◆ getMass()

BlockMass & llvm::BlockFrequencyInfoImplBase::WorkingData::getMass ( )
inline

The mass slot for Node: its own, or that of the outermost packaged loop it heads.

Definition at line 329 of file BlockFrequencyInfoImpl.h.

References Loop, Mass, and Node.

◆ getPackagedLoop()

LoopData * llvm::BlockFrequencyInfoImplBase::WorkingData::getPackagedLoop ( ) const
inline

The outermost loop containing Node that is currently packaged, if any.

Packaging is transient state: this answers what represents Node at the level being processed, not where Node sits in the loop nest.

Definition at line 318 of file BlockFrequencyInfoImpl.h.

References Loop.

Referenced by getResolvedNode().

◆ getResolvedNode()

BlockNode llvm::BlockFrequencyInfoImplBase::WorkingData::getResolvedNode ( ) const
inline

Resolve a node to its representative.

Get the node currently representing Node, which could be a containing loop.

This function should only be called when distributing mass. As long as there are no irreducible edges to Node, then it will have complexity O(1) in this context.

In general, the complexity is O(L), where L is the number of loop headers Node has been packaged into. Since this method is called in the context of distributing mass, L will be the number of loop headers an early exit edge jumps out of.

Definition at line 309 of file BlockFrequencyInfoImpl.h.

References getPackagedLoop(), and Node.

Referenced by isPackaged().

◆ isAPackage()

bool llvm::BlockFrequencyInfoImplBase::WorkingData::isAPackage ( ) const
inline

Has Loop been packaged up?

Definition at line 341 of file BlockFrequencyInfoImpl.h.

References isLoopHeader(), and Loop.

◆ isLoopHeader()

bool llvm::BlockFrequencyInfoImplBase::WorkingData::isLoopHeader ( ) const
inline

Definition at line 283 of file BlockFrequencyInfoImpl.h.

References Loop, and Node.

Referenced by isAPackage().

◆ isPackaged()

bool llvm::BlockFrequencyInfoImplBase::WorkingData::isPackaged ( ) const
inline

Has ContainingLoop been packaged up?

Definition at line 338 of file BlockFrequencyInfoImpl.h.

References getResolvedNode(), and Node.

Member Data Documentation

◆ Loop

LoopData* llvm::BlockFrequencyInfoImplBase::WorkingData::Loop = nullptr

The loop this block is inside.

Definition at line 278 of file BlockFrequencyInfoImpl.h.

Referenced by getContainingLoop(), getMass(), getPackagedLoop(), isAPackage(), and isLoopHeader().

◆ Mass

BlockMass llvm::BlockFrequencyInfoImplBase::WorkingData::Mass

Mass distribution from the entry block.

Definition at line 279 of file BlockFrequencyInfoImpl.h.

Referenced by getMass().

◆ Node

BlockNode llvm::BlockFrequencyInfoImplBase::WorkingData::Node

The documentation for this struct was generated from the following file: