[PATCH] D40594: [InstCombine] miscompile of __builtin_fmod

2017-12-14 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D40594#940571, @spatel wrote: > Added a blurb to the LangRef with https://reviews.llvm.org/rL319437, so I > think we can abandon this patch. Sounds good. https://reviews.llvm.org/D40594 ___ cf

[PATCH] D40594: [InstCombine] miscompile of __builtin_fmod

2017-11-30 Thread Sanjay Patel via Phabricator via cfe-commits
spatel added a comment. Added a blurb to the LangRef with https://reviews.llvm.org/rL319437, so I think we can abandon this patch. https://reviews.llvm.org/D40594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

[PATCH] D40594: [InstCombine] miscompile of __builtin_fmod

2017-11-29 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. By many years of precedent, the "frem" instruction is supposed to match the C fmod(), as opposed to something else like the C99 remainder(); probably worth clarifying in LangRef. https://reviews.llvm.org/D40594 ___ cfe-co

[PATCH] D40594: [InstCombine] miscompile of __builtin_fmod

2017-11-29 Thread Sanjay Patel via Phabricator via cfe-commits
spatel added a comment. Side note: I think there is a different bug here in clang because from what I can tell, we convert the builtin or libcall to 'frem' even when errno could be set by the call. https://reviews.llvm.org/D40044 doesn't address this case because frem is an LLVM instruction rat

[PATCH] D40594: [InstCombine] miscompile of __builtin_fmod

2017-11-29 Thread Sanjay Patel via Phabricator via cfe-commits
spatel added reviewers: efriedma, hfinkel. spatel added a comment. I don't know the history of the frem instruction in IR, and the description in http://llvm.org/docs/LangRef.html#frem-instruction is vague. But based on the existing code, I think this is working as intended. If the instruction

[PATCH] D40594: [InstCombine] miscompile of __builtin_fmod

2017-11-29 Thread Dmitry Venikov via Phabricator via cfe-commits
Quolyk created this revision. Motivation: https://bugs.llvm.org/show_bug.cgi?id=34870 I'm totally not sure this is correct https://reviews.llvm.org/D40594 Files: lib/CodeGen/CGBuiltin.cpp test/CodeGen/builtins.c Index: test/CodeGen/builtins.c ==