[llvm-dev] RFC: Killing undef and spreading poison

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 4 21:13:48 PDT 2017


Hi Peter,

On Thu, Jun 1, 2017 at 6:18 PM, Peter Lawrence via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>             My answer is that step 3, commuting the multiply with the
> sign-extends, is invalid,
> As this is what causes the `udiv` to fault.  I think it is invalid with or
> without the “freeze”,
> why do you think step 3, the commute, without the “freeze" is valid ?

I think it is valid by definition -- since "A *nsw B" does not sign
wrap, "sext(A *nsw B)" == (sext A) * (sext B).  In other words, these
two expressions are inequal only if "A *nsw B" sign wraps.

> Also, do you think you can come up with an example that does not depend on
> signed
> overflow being “undefined” ?

Can you be more specific?  Example that does what?

-- Sanjoy


More information about the llvm-dev mailing list