[llvm-commits] [llvm] r132535 - in /llvm/trunk: lib/Transforms/Scalar/LoopUnswitch.cpp test/Transforms/LoopUnswitch/2011-06-02-CritSwitch.ll

Nick Lewycky nlewycky at google.com
Fri Jun 3 13:19:52 PDT 2011


On 3 June 2011 13:05, Dan Gohman <gohman at apple.com> wrote:

>
> On Jun 2, 2011, at 11:27 PM, Nick Lewycky wrote:
>
> > Author: nicholas
> > Date: Fri Jun  3 01:27:15 2011
> > New Revision: 132535
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=132535&view=rev
> > Log:
> > Bail on unswitching a switch statement for a case with a critical edge.
> We name
> > which edge to split by pred/succ pair, which means that we can end up
> splitting
> > the wrong edge (by case value) in the switch statement entirely. Fixes
> PR10031!
>
> Can this come up with branches instead of switches too? Branches where both
> arms go to the same destination are rare but possible.
>

No, the affected code in RewriteLoopBodyWithConditionConstant only handles
switches. Branches are handled in the code right above it where it does a
simple replacement on the condition with either true or false. It never
touches the CFG.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110603/635e6510/attachment.html>


More information about the llvm-commits mailing list