Provides a uniform way to update dominator tree related data structures.

Synopsis

Declared in <llvm/Analysis/GenericDomTreeUpdater.h>

template<
    typename DerivedT,
    typename DomTreeT,
    typename PostDomTreeT>
class GenericDomTreeUpdater;

Description

CRTP base that applies CFG updates to DomTreeT and/or PostDomTreeT under Eager or Lazy strategies. Derived classes specialize basic‐block deletion for their IR or Machine IR representation.

Type Aliases

Name

Description

BasicBlockT

Basic‐block type used by the dominator trees being updated.

UpdateT

CFG edge update type used by the dominator trees being updated.

Enums

Name

Description

UpdateStrategy

Controls whether CFG updates are applied immediately or deferred.

Member Functions

Name

Description

GenericDomTreeUpdater [constructor]

Constructors

~GenericDomTreeUpdater [destructor]

Assert that pending updates were flushed, then destroy this updater.

applyUpdates

Submit updates to all available trees.

applyUpdatesPermissive

Submit updates to all available trees, filtering duplicates and invalids.

dump

Debug method to help view the internal state of this class.

flush

Apply all pending updates to available trees and flush all BasicBlocks awaiting deletion.

getDomTree

Flush DomTree updates and return DomTree. It flushes Deleted BBs if both trees are up‐to‐date. It must only be called when it has a DomTree.

getPostDomTree

Flush PostDomTree updates and return PostDomTree. It flushes Deleted BBs if both trees are up‐to‐date. It must only be called when it has a PostDomTree.

hasDomTree

Returns true if it holds a DomTreeT.

hasPendingDeletedBB

Returns true if a basic block is awaiting deletion.

hasPendingDomTreeUpdates

Returns true if there are DomTreeT updates queued. Returns false under Eager UpdateStrategy or DT is nullptr.

hasPendingPostDomTreeUpdates

Returns true if there are PostDomTreeT updates queued. Returns false under Eager UpdateStrategy or PDT is nullptr.

hasPendingUpdates

Returns true if either DT or PDT has at least one update pending.

hasPostDomTree

Returns true if it holds a PostDomTreeT.

isBBPendingDeletion

Returns true if DelBB is awaiting deletion.

isEager

Returns true if the current strategy is Eager.

isLazy

Returns true if the current strategy is Lazy.

recalculate

Notify DTU that the entry block was replaced.

splitCriticalEdge

Apply updates that the critical edge (FromBB, ToBB) has been split with NewBB.

Protected Types

Name

Description

CriticalEdge

Helper structure used to hold all the basic blocks involved in the split of a critical edge.

DomTreeUpdate

Pending CFG update, either a normal edge update or a critical‐edge split.

Protected Member Functions

Name

Description

applyDomTreeUpdates

Helper function to apply all pending DomTree updates.

applyPostDomTreeUpdates

Helper function to apply all pending PostDomTree updates.

dropOutOfDateUpdates

Drop all updates applied by all available trees and delete BasicBlocks if all available trees are up‐to‐date.

eraseDelBBNode

Erase Basic Block node before it is unlinked from Function in the DomTree and PostDomTree.

isSelfDominance

Returns true if the update is self dominance.

isUpdateValid

Returns true if the update appears in the LLVM IR.

tryFlushDeletedBB

Helper function to flush deleted BasicBlocks if all available trees are up‐to‐date.

Protected Data Members

Name

Description

DT

Dominator tree being updated, or null if none is held.

DeletedBBs

Basic blocks awaiting deletion under the Lazy strategy.

IsRecalculatingDomTree

True while the dominator tree is being fully recalculated.

IsRecalculatingPostDomTree

True while the post‐dominator tree is being fully recalculated.

PDT

Post‐dominator tree being updated, or null if none is held.

PendDTUpdateIndex

Index of the next pending update to apply to the dominator tree.

PendPDTUpdateIndex

Index of the next pending update to apply to the post‐dominator tree.

PendUpdates

Queued CFG updates not yet applied to available trees.

Strategy

Whether updates are applied eagerly or lazily.

Derived Classes

Name

Description

DomTreeUpdater

Updates DominatorTree and PostDominatorTree for LLVM IR basic blocks.

MachineDomTreeUpdater

Updates MachineDominatorTree and MachinePostDominatorTree.

Created with MrDocs