mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
Tabs -> Spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35841 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b445d0cbb9
commit
0cd0461873
@ -420,7 +420,7 @@ static void AddBlockAndPredsToSet(BasicBlock *BB, BasicBlock *StopBlock,
|
|||||||
/// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
|
/// FindPHIToPartitionLoops - The first part of loop-nestification is to find a
|
||||||
/// PHI node that tells us how to partition the loops.
|
/// PHI node that tells us how to partition the loops.
|
||||||
static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF,
|
static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF,
|
||||||
AliasAnalysis *AA) {
|
AliasAnalysis *AA) {
|
||||||
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) {
|
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) {
|
||||||
PHINode *PN = cast<PHINode>(I);
|
PHINode *PN = cast<PHINode>(I);
|
||||||
++I;
|
++I;
|
||||||
@ -676,11 +676,11 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) {
|
|||||||
// Returns true if BasicBlock A dominates at least one block in vector B
|
// Returns true if BasicBlock A dominates at least one block in vector B
|
||||||
// Helper function for UpdateDomInfoForRevectoredPreds
|
// Helper function for UpdateDomInfoForRevectoredPreds
|
||||||
static bool BlockDominatesAny(BasicBlock* A, std::vector<BasicBlock*>& B, ETForest& ETF) {
|
static bool BlockDominatesAny(BasicBlock* A, std::vector<BasicBlock*>& B, ETForest& ETF) {
|
||||||
for (std::vector<BasicBlock*>::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) {
|
for (std::vector<BasicBlock*>::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) {
|
||||||
if (ETF.dominates(A, *BI))
|
if (ETF.dominates(A, *BI))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// UpdateDomInfoForRevectoredPreds - This method is used to update the four
|
/// UpdateDomInfoForRevectoredPreds - This method is used to update the four
|
||||||
@ -852,36 +852,36 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB,
|
|||||||
// their dominance frontier must be updated to contain NewBB instead.
|
// their dominance frontier must be updated to contain NewBB instead.
|
||||||
//
|
//
|
||||||
for (Function::iterator FI = NewBB->getParent()->begin(),
|
for (Function::iterator FI = NewBB->getParent()->begin(),
|
||||||
FE = NewBB->getParent()->end(); FI != FE; ++FI) {
|
FE = NewBB->getParent()->end(); FI != FE; ++FI) {
|
||||||
DominanceFrontier::iterator DFI = DF->find(FI);
|
DominanceFrontier::iterator DFI = DF->find(FI);
|
||||||
if (DFI == DF->end()) continue; // unreachable block.
|
if (DFI == DF->end()) continue; // unreachable block.
|
||||||
|
|
||||||
// Only consider dominators of NewBBSucc
|
// Only consider dominators of NewBBSucc
|
||||||
if (!DFI->second.count(NewBBSucc)) continue;
|
if (!DFI->second.count(NewBBSucc)) continue;
|
||||||
if (BlockDominatesAny(FI, PredBlocks, ETF)) {
|
if (BlockDominatesAny(FI, PredBlocks, ETF)) {
|
||||||
// If NewBBSucc should not stay in our dominator frontier, remove it.
|
// If NewBBSucc should not stay in our dominator frontier, remove it.
|
||||||
// We remove it unless there is a predecessor of NewBBSucc that we
|
// We remove it unless there is a predecessor of NewBBSucc that we
|
||||||
// dominate, but we don't strictly dominate NewBBSucc.
|
// dominate, but we don't strictly dominate NewBBSucc.
|
||||||
bool ShouldRemove = true;
|
bool ShouldRemove = true;
|
||||||
if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) {
|
if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) {
|
||||||
// Okay, we know that PredDom does not strictly dominate NewBBSucc.
|
// Okay, we know that PredDom does not strictly dominate NewBBSucc.
|
||||||
// Check to see if it dominates any predecessors of NewBBSucc.
|
// Check to see if it dominates any predecessors of NewBBSucc.
|
||||||
for (pred_iterator PI = pred_begin(NewBBSucc),
|
for (pred_iterator PI = pred_begin(NewBBSucc),
|
||||||
E = pred_end(NewBBSucc); PI != E; ++PI)
|
E = pred_end(NewBBSucc); PI != E; ++PI)
|
||||||
if (ETF.dominates(FI, *PI)) {
|
if (ETF.dominates(FI, *PI)) {
|
||||||
ShouldRemove = false;
|
ShouldRemove = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ShouldRemove)
|
if (ShouldRemove)
|
||||||
DF->removeFromFrontier(DFI, NewBBSucc);
|
DF->removeFromFrontier(DFI, NewBBSucc);
|
||||||
DF->addToFrontier(DFI, NewBB);
|
DF->addToFrontier(DFI, NewBB);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user