make inSubLoop much more efficient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2011-01-02 18:53:08 +00:00
parent 83fc584ea8
commit 81a866d615

View File

@ -131,10 +131,7 @@ namespace {
///
bool inSubLoop(BasicBlock *BB) {
assert(CurLoop->contains(BB) && "Only valid if BB is IN the loop");
for (Loop::iterator I = CurLoop->begin(), E = CurLoop->end(); I != E; ++I)
if ((*I)->contains(BB))
return true; // A subloop actually contains this block!
return false;
return LI->getLoopFor(BB) != CurLoop;
}
/// sink - When an instruction is found to only be used outside of the loop,