Do not filter loop if candidate branch is in loop header.
authorDevang Patel <dpatel@apple.com>
Fri, 29 Jun 2007 01:39:53 +0000 (01:39 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 29 Jun 2007 01:39:53 +0000 (01:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37792 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopUnswitch.cpp

index 157b00916cbf975d8c812c2e3cf51d69860c524b..953724448ebc5e6cd676709ff4f743930604a8a9 100644 (file)
@@ -166,8 +166,6 @@ bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) {
   // loop.
   for (Loop::block_iterator I = L->block_begin(), E = L->block_end();
        I != E; ++I) {
-    if (*I == L->getHeader())
-      continue;
     TerminatorInst *TI = (*I)->getTerminator();
     if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
       // If this isn't branching on an invariant condition, we can't unswitch