[llvm-dev] SCEVUDiv simplification

Hongbin Zheng via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 2 18:22:17 PDT 2018


Maybe because when n is 0, it trap? And you simplification get rid of the
trap?

On Thu, Aug 2, 2018 at 10:03 AM Alexandre Isoard via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello,
>
> I noticed that our SCEVUDiv does not simplify anything when the RHS is not
> a constant.
> Is that because there is a potential issue with division by zero being
> simplified?
>
> For instance, would it be okay to simplify:
>
> ((%i * %n)<nuw> /u %n)
>
> into: %i
>
> The way I see it, if %n is 0, then that division is undefined and we can
> "define it", at will, as being %i.
>
> Would that make sense in SCEV world?
>
>
> --
> *Alexandre Isoard*
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180802/8c247149/attachment.html>


More information about the llvm-dev mailing list