LLVM 23.0.0git
EqualBBWrapper Struct Reference

Checking whether two BBs are equal depends on the contents of the BasicBlock and the incoming values of their successor PHINodes. More...

Public Types

using BB2ValueMap = SmallDenseMap<BasicBlock *, Value *, 8>
using Phi2IVsMap = DenseMap<PHINode *, BB2ValueMap>

Static Public Member Functions

static bool canBeMerged (const BasicBlock *BB)

Public Attributes

BasicBlockBB
Phi2IVsMapPhiPredIVs

Detailed Description

Checking whether two BBs are equal depends on the contents of the BasicBlock and the incoming values of their successor PHINodes.

PHINode::getIncomingValueForBlock is O(|Preds|), so we'd like to avoid calling this function on each BasicBlock every time isEqual is called, especially since the same BasicBlock may be passed as an argument multiple times. To do this, we can precompute a map of PHINode -> Pred BasicBlock -> IncomingValue and add it in the Wrapper so isEqual can do O(1) checking of the incoming values.

Definition at line 7999 of file SimplifyCFG.cpp.

Member Typedef Documentation

◆ BB2ValueMap

Definition at line 8003 of file SimplifyCFG.cpp.

◆ Phi2IVsMap

Member Function Documentation

◆ canBeMerged()

bool EqualBBWrapper::canBeMerged ( const BasicBlock * BB)
inlinestatic

Member Data Documentation

◆ BB

BasicBlock* EqualBBWrapper::BB

◆ PhiPredIVs

Phi2IVsMap* EqualBBWrapper::PhiPredIVs

Definition at line 8005 of file SimplifyCFG.cpp.


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