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

Fiona Glaser fglaser at apple.com
Fri Feb 20 19:17:31 PST 2015


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fdivsimplify.diff
Type: application/octet-stream
Size: 8360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150220/2d63589d/attachment.obj>


More information about the llvm-commits mailing list