[llvm-branch-commits] [llvm-branch] r155831 - in /llvm/branches/release_31: ./ lib/Transforms/Scalar/LoopUnswitch.cpp

Bill Wendling isanbard at gmail.com
Mon Apr 30 10:41:43 PDT 2012


Author: void
Date: Mon Apr 30 12:41:42 2012
New Revision: 155831

URL: http://llvm.org/viewvc/llvm-project?rev=155831&view=rev
Log:
Merging r155813:
------------------------------------------------------------------------
r155813 | void | 2012-04-30 02:23:48 -0700 (Mon, 30 Apr 2012) | 1 line

Remove hack from r154987. The problem persists even with it, so it's not even a good hack.
------------------------------------------------------------------------

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:41:42 2012
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155166,155230,155284-155288,155307,155342,155466,155536,155668,155809,155818
+/llvm/trunk:155166,155230,155284-155288,155307,155342,155466,155536,155668,155809,155813,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=155831&r1=155830&r2=155831&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:41:42 2012
@@ -420,15 +420,6 @@
   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.
@@ -633,11 +624,10 @@
 /// LoopCond == Val to simplify the loop.  If we decide that this is profitable,
 /// unswitch the loop, reprocess the pieces, then return true.
 bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val) {
-
   Function *F = loopHeader->getParent();
-
   Constant *CondVal = 0;
   BasicBlock *ExitBlock = 0;
+
   if (IsTrivialUnswitchCondition(LoopCond, &CondVal, &ExitBlock)) {
     // If the condition is trivial, always unswitch. There is no code growth
     // for this case.





More information about the llvm-branch-commits mailing list