[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-13 Thread Sanjay Patel via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318093: [CodeGen] fix const-ness of cbrt and fma (authored by spatel). Changed prior to commit: https://reviews.llvm.org/D39641?vs=122584=122727#toc Repository: rL LLVM

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-13 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added a comment. LGTM https://reviews.llvm.org/D39641 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-11 Thread Sanjay Patel via Phabricator via cfe-commits
spatel updated this revision to Diff 122584. spatel marked an inline comment as done. spatel added a comment. Patch updated: 1. Fix predicate for detecting MSVC - isOSMSVCRT(). 2. Use switch on BuiltinID instead of string matching for "fma". https://reviews.llvm.org/D39641 Files:

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-10 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: lib/Sema/SemaDecl.cpp:12853 + const llvm::Triple = Context.getTargetInfo().getTriple(); + if ((Trip.isGNUEnvironment() || Trip.isKnownWindowsMSVCEnvironment()) && + (Name->isStr("fma") || Name->isStr("fmaf") ||

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-10 Thread Sanjay Patel via Phabricator via cfe-commits
spatel updated this revision to Diff 122545. spatel added a comment. Patch updated: cbrt() is always const. fma() is always const with GNU or Win+MSVC. https://reviews.llvm.org/D39641 Files: include/clang/Basic/Builtins.def lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaDecl.cpp

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-10 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. cbrt() can't underflow; that's not how cube roots work. If 0 x. See also the definition of rootn() in IEEE 754 (which specifies no exceptions for n=3). For fma(), sure, I guess we could whitelist glibc and msvcrt, if you're worried there's some

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-10 Thread Sanjay Patel via Phabricator via cfe-commits
spatel added a comment. Based on the comments in https://reviews.llvm.org/D39611, I think we have to change this (although I'd be happy to be wrong). 1. cbrt() can underflow and could set errno to ERANGE. 2. fma() can overflow or underflow and set errno to ERANGE. We could still make an

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-07 Thread Sanjay Patel via Phabricator via cfe-commits
spatel updated this revision to Diff 121898. spatel added a comment. Patch updated - no code or functional changes from the last rev. I split the and test files up, so I can update those independently and not incur svn conflicts. https://reviews.llvm.org/D39641 Files:

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added a comment. This revision is now accepted and ready to land. LGTM, but wait a couple days before you commit to see if anyone else wants to comment. https://reviews.llvm.org/D39641 ___ cfe-commits

[PATCH] D39641: [CodeGen] make cbrt and fma constant (never set errno)

2017-11-05 Thread Sanjay Patel via Phabricator via cfe-commits
spatel created this revision. Herald added a subscriber: mcrosier. Splitting cbrt and fma off from https://reviews.llvm.org/D39611, so we can deal with complex.h separately. I've also gone ahead with a 'fix' for the fma case in CodeGenFunction::EmitBuiltinExpr(). But as noted previously,