|
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 8040 of file SimplifyCFG.cpp.
| using EqualBBWrapper::BB2ValueMap = SmallDenseMap<BasicBlock *, Value *, 8> |
Definition at line 8044 of file SimplifyCFG.cpp.
| using EqualBBWrapper::Phi2IVsMap = DenseMap<PHINode *, BB2ValueMap> |
Definition at line 8045 of file SimplifyCFG.cpp.
|
inlinestatic |
Definition at line 8051 of file SimplifyCFG.cpp.
References assert(), BB, llvm::dyn_cast(), and llvm::pred_empty().
| BasicBlock* EqualBBWrapper::BB |
Definition at line 8041 of file SimplifyCFG.cpp.
Referenced by canBeMerged(), and llvm::DenseMapInfo< const EqualBBWrapper * >::getHashValue().
| Phi2IVsMap* EqualBBWrapper::PhiPredIVs |
Definition at line 8046 of file SimplifyCFG.cpp.