mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 07:41:38 +00:00
Make method private. Keep coding standard.
llvm-svn: 177348
This commit is contained in:
parent
a43a646d71
commit
89b78a9580
@ -36,10 +36,6 @@ namespace {
|
||||
// Possibly eliminate loop L if it is dead.
|
||||
bool runOnLoop(Loop *L, LPPassManager &LPM);
|
||||
|
||||
bool IsLoopDead(Loop* L, SmallVector<BasicBlock*, 4>& exitingBlocks,
|
||||
SmallVector<BasicBlock*, 4>& exitBlocks,
|
||||
bool &Changed, BasicBlock *Preheader);
|
||||
|
||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.addRequired<DominatorTree>();
|
||||
AU.addRequired<LoopInfo>();
|
||||
@ -53,6 +49,12 @@ namespace {
|
||||
AU.addPreservedID(LoopSimplifyID);
|
||||
AU.addPreservedID(LCSSAID);
|
||||
}
|
||||
|
||||
private:
|
||||
bool isLoopDead(Loop *L, SmallVector<BasicBlock*, 4> &exitingBlocks,
|
||||
SmallVector<BasicBlock*, 4> &exitBlocks,
|
||||
bool &Changed, BasicBlock *Preheader);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@ -71,10 +73,10 @@ Pass* llvm::createLoopDeletionPass() {
|
||||
return new LoopDeletion();
|
||||
}
|
||||
|
||||
/// IsLoopDead - Determined if a loop is dead. This assumes that we've already
|
||||
/// isLoopDead - Determined if a loop is dead. This assumes that we've already
|
||||
/// checked for unique exit and exiting blocks, and that the code is in LCSSA
|
||||
/// form.
|
||||
bool LoopDeletion::IsLoopDead(Loop* L,
|
||||
bool LoopDeletion::isLoopDead(Loop *L,
|
||||
SmallVector<BasicBlock*, 4> &exitingBlocks,
|
||||
SmallVector<BasicBlock*, 4> &exitBlocks,
|
||||
bool &Changed, BasicBlock *Preheader) {
|
||||
@ -93,7 +95,7 @@ bool LoopDeletion::IsLoopDead(Loop* L,
|
||||
// block. If there are different incoming values for different exiting
|
||||
// blocks, then it is impossible to statically determine which value should
|
||||
// be used.
|
||||
for (unsigned i = 1; i < exitingBlocks.size(); ++i) {
|
||||
for (unsigned i = 1, e = exitingBlocks.size(); i < e; ++i) {
|
||||
if (incoming != P->getIncomingValueForBlock(exitingBlocks[i]))
|
||||
return false;
|
||||
}
|
||||
@ -158,7 +160,7 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) {
|
||||
|
||||
// Finally, we have to check that the loop really is dead.
|
||||
bool Changed = false;
|
||||
if (!IsLoopDead(L, exitingBlocks, exitBlocks, Changed, preheader))
|
||||
if (!isLoopDead(L, exitingBlocks, exitBlocks, Changed, preheader))
|
||||
return Changed;
|
||||
|
||||
// Don't remove loops for which we can't solve the trip count.
|
||||
|
Loading…
x
Reference in New Issue
Block a user