[PATCH] IndVarSimplify does not check if loop invariant expansion can trap

James Molloy james at jamesmolloy.co.uk
Tue Jun 4 06:49:02 PDT 2013


Hi David,

Might a more performant solution not be to wrap any hoisted instructions
that are not safe to expand in a conditional that tests if the loop will be
entered at least once?

How difficult would this be to implement?

Cheers,

James

On 4 June 2013 12:22, David Majnemer <david.majnemer at gmail.com> wrote:

> IndVarSimplify is willing to move divide instructions outside of their
> loop bodies if they are invariant of the loop. However, it may not be safe
> to expand them if we do not know if they can trap.
>
> The attached patch checks to see if it is not safe to expand the
> instruction and skips doing so if this would be the case.
>
> This fixes PR16041.
>
> Testcase by Rafael Ávila de Espíndola.
>
> --
> David Majnemer
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130604/f60570cc/attachment.html>


More information about the llvm-commits mailing list