[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-06 Thread Steve Canon via Phabricator via cfe-commits
scanon added a comment. TS18661-5 is quite vague on what the intended semantics for the pragma are. These pragmas are intended to be bindings of clause 10.4 of IEEE 754, which is also pretty wishy-washy on the whole, but it's worth noting that clause 10 is titled *expression evaluation*

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-06 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. The ISO C proposal is here http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2407.pdf but the details are in the IEEE standards documents. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78827/new/

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-06 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. That's actually really interesting. Is there a paper describing the desired model in more detail? I think the natural interpretation of this pragma is to say that the specific operations written within the pragma are considered to be associative and are therefore

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-06 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. BTW there is a proposal http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2421.pdf at the ISO C meeting to support some new floating point pragmas including #pragma STDC FENV_ALLOW_ASSOCIATIVE_LAW on-off-switch The committee wants to see an implementation(s) to ensure

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-06 Thread Melanie Blower via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc355bec749e9: Add support for #pragma clang fp reassociate(on|off) (authored by mibintc). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78827/new/

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-05 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. LGTM, too. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78827/new/ https://reviews.llvm.org/D78827 ___ cfe-commits mailing list

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-05 Thread Steve Canon via Phabricator via cfe-commits
scanon accepted this revision. scanon added a comment. This revision is now accepted and ready to land. My concerns have been addressed. Thanks for bearing with me, Melanie! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78827/new/

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-05 Thread Steve Canon via Phabricator via cfe-commits
scanon added a comment. (Please get one additional sign off before committing; I'm mainly signing off on the numerics model aspect). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78827/new/ https://reviews.llvm.org/D78827

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-05 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 262217. mibintc retitled this revision from "Add support for #pragma clang fp reassociate(fast|off) -- floating point control of associative math transformations" to "Add support for #pragma clang fp reassociate(on|off) -- floating point control of

[PATCH] D78827: Add support for #pragma clang fp reassociate(fast|off) -- floating point control of associative math transformations

2020-05-05 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. That makes sense, thanks. I think I'm comfortable using on/off for this, but it's definitely good to stop and consider, and you're absolutely right that it needs to be documented. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D78827: Add support for #pragma clang fp reassociate(fast|off) -- floating point control of associative math transformations

2020-05-05 Thread Steve Canon via Phabricator via cfe-commits
scanon added a comment. > I don't think the C standard is likely to ever bless reassociative FP math > with an expression-local restriction. Steve, do you actually think that would > be a useful optimization mode? I think it's pretty unlikely that C would do this, as well. It is plausibly a

[PATCH] D78827: Add support for #pragma clang fp reassociate(fast|off) -- floating point control of associative math transformations

2020-05-05 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. The reason we call FP contraction "fast" instead of "on" when it's cross-statement is because "on" is supposed to be consistent with the C language rules, whereas "fast" is stronger. There's no analogous situation with reassociation; I don't think the C standard is

[PATCH] D78827: Add support for #pragma clang fp reassociate(fast|off) -- floating point control of associative math transformations

2020-05-05 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. I checked with FPGA folks and confirm what @scanon says is correct, the reassoc fast math flag enables reassociation across multiple statements, so i changed the syntax to use 'fast' and 'off', and changed the documentation Repository: rG LLVM Github Monorepo

[PATCH] D78827: Add support for #pragma clang fp reassociate(fast|off) -- floating point control of associative math transformations

2020-05-05 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 262108. mibintc retitled this revision from "Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations" to "Add support for #pragma clang fp reassociate(fast|off) -- floating point control of

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 261921. mibintc added a comment. I fixed the issues that @rjmccall mentioned. I don't yet have an answer for @scanon, need to get back to you about that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3182 +enabled for the translation unit with the ``-fassociative-math`` flag. +The pragma can take two values: ``on`` and ``off``. + mibintc wrote: > scanon wrote: > > rjmccall wrote: > >

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked an inline comment as done. mibintc added a comment. A reply to @scanon Comment at: clang/docs/LanguageExtensions.rst:3182 +enabled for the translation unit with the ``-fassociative-math`` flag. +The pragma can take two values: ``on`` and ``off``. +

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Just minor requests now. Comment at: clang/docs/LanguageExtensions.rst:3177 +Both floating point reassociation and floating point contraction can be +controlled with this pragma. +``#pragma clang fp reassoc`` allows control over the reassociation

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread Steve Canon via Phabricator via cfe-commits
scanon added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3182 +enabled for the translation unit with the ``-fassociative-math`` flag. +The pragma can take two values: ``on`` and ``off``. + rjmccall wrote: > Do you want to add an example here?

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 261875. mibintc retitled this revision from "Add support for #pragma clang fp reassoc(on|off) -- floating point control of associative math transformations" to "Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative

[PATCH] D78827: Add support for #pragma clang fp reassociate(on|off) -- floating point control of associative math transformations

2020-05-04 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 4 inline comments as done. mibintc added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:186 +FPM_Fast }; rjmccall wrote: > I'm not sure I think this fusion was an improvement; the net effect was to > remove a few