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

Peter Lawrence via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 8 11:12:29 PDT 2017


> On Jun 8, 2017, at 10:33 AM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
> 
> Hi Peter,
> 
> On Thu, Jun 8, 2017 at 9:41 AM, Peter Lawrence
> <peterl95124 at sbcglobal.net> wrote:
>> 
>>> On Jun 7, 2017, at 2:23 PM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>>> 
>>> Since most add/sub operations compiled from C have the nsw attribute, we cannot simply restrict movement of these instructions.
>> 
>> Nuno,
>>          I’m not saying the operations can’t be moved,
>> I’m saying that once you move one the ‘nsw’ attribute no longer applies,
>> unless you can mathematically prove that it still does,
>> otherwise an “add nsw” has to be converted to plain “add”.
>> 
>> It is only by illegally retaining the ‘nsw’ after hoisting the multiply out of the ‘if’ statement
>> that subsequent transformations yield end-to-end-miscompilation in Sanjoy’s example.
> 
> 
>> I think the LLVM community in general has misunderstood and misused ‘nsw’, don’t you agree now ?
> 
> FYI, I think it is poor form to insinuate such things when you clearly
> haven't made an effort to dig back and understand the all of prior
> discussions we've had in this area (hint: we've discussed and
> explicitly decided to not implement the semantics you're suggesting).
> Of course, fresh ideas are always welcome but I suggest you start by
> first reading http://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf
> and some of the mailing list discussions we've had in the past on this
> topic.

Sanjoy,
            I have read the paper, and I dug the archives all the way back to Nov to find
Your example with the nsw-multiply-and-commuting-sext problem.

The reason I keep asking for additional examples is that this one where
You have illegally transformed the ‘nsw’ isn’t convincing. So please,
Provide some additional examples, or some pointers going farther back
Than last Nov in the archives, especially ones that show why you decided
To allow the illegal transformation of ‘nsw’.

Peter Lawrence.



> 
> Thanks!
> -- Sanjoy



More information about the llvm-dev mailing list