mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-11 13:29:36 +00:00
Put this expensive check below the less expensive ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155166 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2ae3467ce
commit
dc21604d4a
@ -409,15 +409,6 @@ bool LoopUnswitch::processCurrentLoop() {
|
|||||||
if (!currentLoop->isSafeToClone())
|
if (!currentLoop->isSafeToClone())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Loops with invokes, whose unwind edge escapes the loop, cannot be
|
|
||||||
// unswitched because splitting their edges are non-trivial and don't preserve
|
|
||||||
// loop simplify information.
|
|
||||||
for (Loop::block_iterator I = currentLoop->block_begin(),
|
|
||||||
E = currentLoop->block_end(); I != E; ++I)
|
|
||||||
if (const InvokeInst *II = dyn_cast<InvokeInst>((*I)->getTerminator()))
|
|
||||||
if (!currentLoop->contains(II->getUnwindDest()))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Without dedicated exits, splitting the exit edge may fail.
|
// Without dedicated exits, splitting the exit edge may fail.
|
||||||
if (!currentLoop->hasDedicatedExits())
|
if (!currentLoop->hasDedicatedExits())
|
||||||
return false;
|
return false;
|
||||||
@ -429,6 +420,15 @@ bool LoopUnswitch::processCurrentLoop() {
|
|||||||
if (!BranchesInfo.countLoop(currentLoop))
|
if (!BranchesInfo.countLoop(currentLoop))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Loops with invokes, whose unwind edge escapes the loop, cannot be
|
||||||
|
// unswitched because splitting their edges are non-trivial and don't preserve
|
||||||
|
// loop simplify information.
|
||||||
|
for (Loop::block_iterator I = currentLoop->block_begin(),
|
||||||
|
E = currentLoop->block_end(); I != E; ++I)
|
||||||
|
if (const InvokeInst *II = dyn_cast<InvokeInst>((*I)->getTerminator()))
|
||||||
|
if (!currentLoop->contains(II->getUnwindDest()))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Loop over all of the basic blocks in the loop. If we find an interior
|
// Loop over all of the basic blocks in the loop. If we find an interior
|
||||||
// block that is branching on a loop-invariant condition, we can unswitch this
|
// block that is branching on a loop-invariant condition, we can unswitch this
|
||||||
// loop.
|
// loop.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user