[LLVMdev] RFC: Proposal to Remove Poison

Hal Finkel hfinkel at anl.gov
Sun Feb 8 10:02:59 PST 2015


----- Original Message -----
> From: "Reid Kleckner" <rnk at google.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "David Majnemer" <david.majnemer at gmail.com>, "Nuno Lopes" <nuno.lopes at ist.utl.pt>, "John Regehr"
> <regehr at cs.utah.edu>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Sunday, February 8, 2015 11:47:09 AM
> Subject: Re: [LLVMdev] RFC: Proposal to Remove Poison
> 
> On Sun, Feb 8, 2015 at 8:38 AM, Hal Finkel < hfinkel at anl.gov > wrote:
> 
> Currently, we might replace:
> %cmp = icmp sgt i32 undef, INT_MAX -> i1 false
> 
> According to this proposal, we could replace:
> %cmp = icmp sgt i32 undef, INT_MAX -> i1 undef
> 
> While replacing it with false is still allowed, so is replacing it
> with true. I'm not sure this makes sense.
> 
> 
> I think your example is a compelling argument for making icmp more
> powerful and less obvious when you replace INT_MAX with an unknown
> variable %a:
> 
> %cmp = icmp sgt i32 undef, %a
> 
> 
> We'd like to make %cmp undef without having to prove that %a is not
> INT_MAX. I'm pretty sure instcombine does something like this today,
> and this change would provide the basis for it.


When you say, "we'd like to", I'm assuming your justification for this is so that we can model poison using these undef semantics. Is that correct?

 -Hal

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list