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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Jun 4 13:02:30 PDT 2013


> 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 --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: application/octet-stream
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130604/aa71b8e1/attachment.obj>


More information about the llvm-commits mailing list