[llvm-commits] [llvm] r91009 - /llvm/trunk/lib/Transforms/Scalar/LICM.cpp

Chris Lattner clattner at apple.com
Wed Dec 9 16:48:44 PST 2009


testcase?

On Dec 9, 2009, at 4:25 PM, Eric Christopher wrote:

> Author: echristo
> Date: Wed Dec  9 18:25:41 2009
> New Revision: 91009
>
> URL: http://llvm.org/viewvc/llvm-project?rev=91009&view=rev
> Log:
> Make sure the immediate dominator isn't NULL through iterations
> of the loop. We could get to this condition via indirect
> branches.
>
> Modified:
>    llvm/trunk/lib/Transforms/Scalar/LICM.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/LICM.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LICM.cpp?rev=91009&r1=91008&r2=91009&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/LICM.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/LICM.cpp Wed Dec  9 18:25:41 2009
> @@ -160,16 +160,17 @@
>
>       // Because the exit block is not in the loop, we know we have  
> to get _at
>       // least_ its immediate dominator.
> -      do {
> -        // Get next Immediate Dominator.
> -        IDom = IDom->getIDom();
> -
> +      IDom = IDom->getIDom();
> +
> +      while (IDom && IDom != BlockInLoopNode) {
>         // If we have got to the header of the loop, then the  
> instructions block
>         // did not dominate the exit node, so we can't hoist it.
>         if (IDom->getBlock() == LoopHeader)
>           return false;
>
> -      } while (IDom != BlockInLoopNode);
> +        // Get next Immediate Dominator.
> +        IDom = IDom->getIDom();
> +      };
>
>       return true;
>     }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list