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

James Molloy james at jamesmolloy.co.uk
Wed Jun 5 01:15:28 PDT 2013


Rafael,

Thanks for that investigation, it's obviously not worth any effort to fix.

Thanks!

James

On 4 June 2013 21:02, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

> > Like a divide operation where the divisor never happens to be zero? or
> am I
> > misunderstanding the patch?
> >
> > My understanding is that now we will not hoist divides out of induction
> > variable expressions where before we did, because divides can trap. Most
> > divides in user code don't trap, so I don't see how you can conclude that
> > the optimization is not firing on user code.
>
> I have applied the attached patch to llvm. With it I was able to
> bootstrap clang and build the test-suite (with "lnt runtest nt
> --sandbox /home/espindola/llvm/test-suite-obj --cc
> ~/llvm/build/bin/clang --test-suite /home/espindola/llvm/test-suite
> --simple -j 8").
>
> In fact, the only thing that I got a failure on was during check-all
> where Transforms/IndVarSimplify/udiv-invariant-but-traps.ll hits the
> assert (as expected).
>
> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130605/005e29d5/attachment.html>


More information about the llvm-commits mailing list