forked from OSchip/llvm-project
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:
parent
29f771ba21
commit
cb853de534
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue