|
LLVM 23.0.0git
|
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 | |
| BasicBlock * | BB |
| Phi2IVsMap * | PhiPredIVs |
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.
| using EqualBBWrapper::BB2ValueMap = SmallDenseMap<BasicBlock *, Value *, 8> |
Definition at line 8003 of file SimplifyCFG.cpp.
| using EqualBBWrapper::Phi2IVsMap = DenseMap<PHINode *, BB2ValueMap> |
Definition at line 8004 of file SimplifyCFG.cpp.
|
inlinestatic |
Definition at line 8010 of file SimplifyCFG.cpp.
References assert(), BB, llvm::dyn_cast(), llvm::BranchInst::isUnconditional(), and llvm::pred_empty().
| BasicBlock* EqualBBWrapper::BB |
Definition at line 8000 of file SimplifyCFG.cpp.
Referenced by canBeMerged(), and llvm::DenseMapInfo< const EqualBBWrapper * >::getHashValue().
| Phi2IVsMap* EqualBBWrapper::PhiPredIVs |
Definition at line 8005 of file SimplifyCFG.cpp.