InstSimplify: fold 0/X to 0 if nnan and nsz

Michael Ilseman milseman at apple.com
Sun Feb 22 20:49:42 PST 2015


Add a comment before the transformation, otherwise LGTM.


> On Feb 20, 2015, at 7:17 PM, Fiona Glaser <fglaser at apple.com> wrote:
> 
> Per the subject! This came up in real production code, so it’s not merely an artificial test case. I was kind of surprised this combine seemed to be missing; is there some reason it’s not legitimate, or was it just forgotten?
> 
> (Also, fast-math logic: we need nnan because 0 / 0 can cause NaN, and we need nsz because we don’t know the sign of X, so 0/X could result in either 0 or -0 depending on the sign of X.)
> 
> Fiona
> 
> 
> <fdivsimplify.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list