[llvm-commits] [PATCH] Replace SUB with CMP if possible on X86

Manman Ren mren at apple.com
Thu May 31 08:17:35 PDT 2012


(x -y < 0) is not equivalent to (x < y) due to overflowing cases.

Thanks,
Manman

On May 31, 2012, at 1:14 AM, Rotem, Nadav wrote:

> Hi Manman, 
> 
> I think that I missed the previous discussion, but I have a general questions. 
> 
> Why don't you replace the sequence:
> 
> +  %sub = sub nsw i64 %x, %y
> +  %cmp = icmp slt i64 %sub, 0
> 
> With 
> 
> cmp slt %x, %y ?
> 
> 
> Nadav
> 
> -----Original Message-----
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Manman Ren
> Sent: Wednesday, May 30, 2012 23:55
> To: llvm-commits at cs.uiuc.edu
> Subject: Re: [llvm-commits] [PATCH] Replace SUB with CMP if possible on X86
> 
> 
> SUB with memory operand should not be optimized.
> Updated patch is attached.
> 
> Manman
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
> 
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
> 




More information about the llvm-commits mailing list