[llvm-branch-commits] [llvm-branch] r155830 - in /llvm/branches/release_31: ./ lib/Transforms/Scalar/LoopUnswitch.cpp
Bill Wendling
isanbard at gmail.com
Mon Apr 30 10:40:59 PDT 2012
Author: void
Date: Mon Apr 30 12:40:59 2012
New Revision: 155830
URL: http://llvm.org/viewvc/llvm-project?rev=155830&view=rev
Log:
Merging r155166:
------------------------------------------------------------------------
r155166 | void | 2012-04-19 16:31:07 -0700 (Thu, 19 Apr 2012) | 1 line
Put this expensive check below the less expensive ones.
------------------------------------------------------------------------
Modified:
llvm/branches/release_31/ (props changed)
llvm/branches/release_31/lib/Transforms/Scalar/LoopUnswitch.cpp
Propchange: llvm/branches/release_31/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 30 12:40:59 2012
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155230,155284-155288,155307,155342,155466,155536,155668,155809,155818
+/llvm/trunk:155166,155230,155284-155288,155307,155342,155466,155536,155668,155809,155818
Modified: llvm/branches/release_31/lib/Transforms/Scalar/LoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_31/lib/Transforms/Scalar/LoopUnswitch.cpp?rev=155830&r1=155829&r2=155830&view=diff
==============================================================================
--- llvm/branches/release_31/lib/Transforms/Scalar/LoopUnswitch.cpp (original)
+++ llvm/branches/release_31/lib/Transforms/Scalar/LoopUnswitch.cpp Mon Apr 30 12:40:59 2012
@@ -409,15 +409,6 @@
if (!currentLoop->isSafeToClone())
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.
if (!currentLoop->hasDedicatedExits())
return false;
@@ -429,6 +420,15 @@
if (!BranchesInfo.countLoop(currentLoop))
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
// block that is branching on a loop-invariant condition, we can unswitch this
// loop.
More information about the llvm-branch-commits
mailing list