mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[IVUsers] Check LoopSimplify cache earlier (NFC)
Check the cache before calling isLoopSimplifyForm(). Otherwise we'd always perform the check for the innermost loop and only skip it for dominating loops.
This commit is contained in:
parent
3e6a01ab89
commit
28b15148fb
@ -101,12 +101,12 @@ static bool isSimplifiedLoopNest(BasicBlock *BB, const DominatorTree *DT,
|
||||
BasicBlock *DomBB = Rung->getBlock();
|
||||
Loop *DomLoop = LI->getLoopFor(DomBB);
|
||||
if (DomLoop && DomLoop->getHeader() == DomBB) {
|
||||
// If the domtree walk reaches a loop with no preheader, return false.
|
||||
if (!DomLoop->isLoopSimplifyForm())
|
||||
return false;
|
||||
// If we have already checked this loop nest, stop checking.
|
||||
if (SimpleLoopNests.count(DomLoop))
|
||||
break;
|
||||
// If the domtree walk reaches a loop with no preheader, return false.
|
||||
if (!DomLoop->isLoopSimplifyForm())
|
||||
return false;
|
||||
// If we have not already checked this loop nest, remember the loop
|
||||
// header nearest to BB. The nearest loop may not contain BB.
|
||||
if (!NearestLoop)
|
||||
|
Loading…
Reference in New Issue
Block a user