[llvm-commits] PR12343 PATCH: -loop-unswitch crash on indirect branch

Andrew Trick atrick at apple.com
Fri Mar 30 19:04:22 PDT 2012

On Mar 29, 2012, at 11:36 PM, Stepan Dyatkovskiy <STPWORLD at narod.ru> wrote:

> Hi all. Please find patch for review.
> It was discussed here:
> http://llvm.org/bugs/show_bug.cgi?id=12343
> We have not trivial way for splitting edges that are goes from indirect branch. We can do it with some tricks, but it should be additionally discussed. And it is still dangerous due to difficulty of indirect branches controlling.
> This is a fast fix, that forbids this case for unswitching.
> -Stepan.<pr12343-fastfix.patch>

Hi Stepan,

I have a couple minor cleanup suggestions, then you can immediately commit. Sorry I didn't mention these the first time around.

ExitBlocks can be passed simply as SmallVectorImpl<BasicBlock*>.

You can directly iterate over ExitBlocks preds like this:
for (pred_iterator I = pred_begin(ExitBlock), E = pred_end(ExitBlock);...


More information about the llvm-commits mailing list