projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Boost the power of phi node constant folding slightly: if all
[oota-llvm.git]
/
lib
/
Analysis
/
RegionInfo.cpp
diff --git
a/lib/Analysis/RegionInfo.cpp
b/lib/Analysis/RegionInfo.cpp
index 4a0a9a3ccecdcab72165cbff207737ad43f0d28e..6725cfd28fabbcff550aee75f182793840331a47 100644
(file)
--- a/
lib/Analysis/RegionInfo.cpp
+++ b/
lib/Analysis/RegionInfo.cpp
@@
-45,7
+45,7
@@
STATISTIC(numSimpleRegions, "The # of simple regions");
/// PrintStyle - Print region in difference ways.
enum PrintStyle { PrintNone, PrintBB, PrintRN };
/// PrintStyle - Print region in difference ways.
enum PrintStyle { PrintNone, PrintBB, PrintRN };
-cl::opt<enum PrintStyle> printStyle("print-region-style", cl::Hidden,
+
static
cl::opt<enum PrintStyle> printStyle("print-region-style", cl::Hidden,
cl::desc("style of printing regions"),
cl::values(
clEnumValN(PrintNone, "none", "print no details"),
cl::desc("style of printing regions"),
cl::values(
clEnumValN(PrintNone, "none", "print no details"),
@@
-140,8
+140,7
@@
bool Region::isSimple() const {
BasicBlock *entry = getEntry(), *exit = getExit();
BasicBlock *entry = getEntry(), *exit = getExit();
- // TopLevelRegion
- if (!exit)
+ if (isTopLevelRegion())
return false;
for (pred_iterator PI = pred_begin(entry), PE = pred_end(entry); PI != PE;
return false;
for (pred_iterator PI = pred_begin(entry), PE = pred_end(entry); PI != PE;
@@
-444,7
+443,7
@@
void Region::dump() const {
void Region::clearNodeCache() {
// Free the cached nodes.
for (BBNodeMapT::iterator I = BBNodeMap.begin(),
void Region::clearNodeCache() {
// Free the cached nodes.
for (BBNodeMapT::iterator I = BBNodeMap.begin(),
- IE = BBNodeMap.end(); I != IE; ++I
E
)
+ IE = BBNodeMap.end(); I != IE; ++I)
delete I->second;
BBNodeMap.clear();
delete I->second;
BBNodeMap.clear();
@@
-663,6
+662,7
@@
void RegionInfo::releaseMemory() {
}
RegionInfo::RegionInfo() : FunctionPass(ID) {
}
RegionInfo::RegionInfo() : FunctionPass(ID) {
+ initializeRegionInfoPass(*PassRegistry::getPassRegistry());
TopLevelRegion = 0;
}
TopLevelRegion = 0;
}
@@
-810,9
+810,10
@@
RegionInfo::getCommonRegion(SmallVectorImpl<BasicBlock*> &BBs) const {
void RegionInfo::splitBlock(BasicBlock* NewBB, BasicBlock *OldBB)
{
Region *R = getRegionFor(OldBB);
void RegionInfo::splitBlock(BasicBlock* NewBB, BasicBlock *OldBB)
{
Region *R = getRegionFor(OldBB);
+
setRegionFor(NewBB, R);
setRegionFor(NewBB, R);
- while (R->getEntry() == OldBB &&
R->getParent
()) {
+ while (R->getEntry() == OldBB &&
!R->isTopLevelRegion
()) {
R->replaceEntry(NewBB);
R = R->getParent();
}
R->replaceEntry(NewBB);
R = R->getParent();
}