a previous patch completely disabled trivial unswitching, this fixees it.

Thanks to nate for pointing this out :)

llvm-svn: 26280
This commit is contained in:
Chris Lattner 2006-02-18 01:32:04 +00:00
parent 29f771ba21
commit cb853de534
1 changed files with 0 additions and 1 deletions

View File

@ -168,7 +168,6 @@ static bool isTrivialLoopExitBlockHelper(Loop *L, BasicBlock *BB,
static BasicBlock *isTrivialLoopExitBlock(Loop *L, BasicBlock *BB) { static BasicBlock *isTrivialLoopExitBlock(Loop *L, BasicBlock *BB) {
std::set<BasicBlock*> Visited; std::set<BasicBlock*> Visited;
Visited.insert(L->getHeader()); // Branches to header are ok. Visited.insert(L->getHeader()); // Branches to header are ok.
Visited.insert(BB); // Don't revisit BB after we do.
BasicBlock *ExitBB = 0; BasicBlock *ExitBB = 0;
if (isTrivialLoopExitBlockHelper(L, BB, ExitBB, Visited)) if (isTrivialLoopExitBlockHelper(L, BB, ExitBB, Visited))
return ExitBB; return ExitBB;