[PATCH] Teach IndVarSimplify to add nuw and nsw to operations that provably don't overflow.

Hal Finkel hfinkel at anl.gov
Tue Dec 23 16:31:06 PST 2014


----- Original Message -----
> From: "Sanjoy Das" <sanjoy at playingwithpointers.com>
> To: sanjoy at playingwithpointers.com, atrick at apple.com, "david majnemer" <david.majnemer at gmail.com>, hfinkel at anl.gov
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Tuesday, December 23, 2014 6:22:31 PM
> Subject: Re: [PATCH] Teach IndVarSimplify to add nuw and nsw to operations that provably don't overflow.
> 
> Hi Hal,
> 
> Thank you for the review.
> 
> This is the context:
>  http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-December/079885.html
>  This patch tries to fix point (1) as mentioned in the mail
> 
> I am not aware of transforms that are valid only on overflowing
> operators: as far as I can tell, adding nsw / nuw is a strict
> increase in the amount of information there is available about an
> instruction.  Can you give me some pointers on where to look for
> examples?  Don't bother if you don't have them handy, I'll look for
> them myself later.

We really need to add this to an FAQ somewhere, it comes up a lot... 

For example, see slides 20-31 of http://llvm.org/devmtg/2014-10/Slides/Menendez-Alive.pdf -- shows a reassociation example valid only without the no-wrap flags. There are other examples too that have been discussed on the mailing list.

> 
> As an aside, I'll be on vacation starting a few hours from now, so I
> won't be able to check this in before the first week of 2015.

Okay; enjoy your vacation!

 -Hal

> 
> 
> http://reviews.llvm.org/D6748
> 
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 
> 

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



More information about the llvm-commits mailing list