mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
RegionInfo: Update RegionInfo after a BB was split.
llvm-svn: 116398
This commit is contained in:
parent
6aac855519
commit
85dce73ab5
@ -638,6 +638,12 @@ public:
|
||||
return TopLevelRegion;
|
||||
}
|
||||
|
||||
/// @brief Update RegionInfo after a basic block was split.
|
||||
///
|
||||
/// @param NewBB The basic block that was created before OldBB.
|
||||
/// @param OldBB The old basic block.
|
||||
void splitBlock(BasicBlock* NewBB, BasicBlock *OldBB);
|
||||
|
||||
/// @brief Clear the Node Cache for all Regions.
|
||||
///
|
||||
/// @see Region::clearNodeCache()
|
||||
|
@ -807,6 +807,19 @@ RegionInfo::getCommonRegion(SmallVectorImpl<BasicBlock*> &BBs) const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RegionInfo::splitBlock(BasicBlock* NewBB, BasicBlock *OldBB)
|
||||
{
|
||||
Region *R = getRegionFor(OldBB);
|
||||
setRegionFor(NewBB, R);
|
||||
|
||||
while (R->getEntry() == OldBB && R->getParent()) {
|
||||
R->replaceEntry(NewBB);
|
||||
R = R->getParent();
|
||||
}
|
||||
|
||||
setRegionFor(OldBB, R);
|
||||
}
|
||||
|
||||
char RegionInfo::ID = 0;
|
||||
INITIALIZE_PASS_BEGIN(RegionInfo, "regions",
|
||||
"Detect single entry single exit regions", true, true)
|
||||
|
Loading…
Reference in New Issue
Block a user