[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-23 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D69272#1794630 , @sepavloff wrote: > Putting restriction on use of the pragma is of course, a temporary solution, > it is not usable in all cases. But for some cases it is usable in production > code. Where small pieces of code

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D69272#1794630 , @sepavloff wrote: > In D69272#1793234 , @rjmccall wrote: > > > In D69272#1792928 , @sepavloff > > wrote: > > > > > @hfinkel

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-22 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D69272#1793234 , @rjmccall wrote: > In D69272#1792928 , @sepavloff wrote: > > > @hfinkel proposed to use outlining to extract a block with the #pragma to > > separate function. It

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-20 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D69272#1792928 , @sepavloff wrote: > In D69272#1792877 , @kpn wrote: > > > My understanding of this patch is that it only allows the #pragma at the > > top of each function. It doesn't

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D69272#1792877 , @kpn wrote: > My understanding of this patch is that it only allows the #pragma at the top > of each function. It doesn't allow it in blocks inside the function. So if a > function has a block inside it

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-20 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D69272#1792856 , @mibintc wrote: > In D69272#1717021 , @kpn wrote: > > > Is there a way forward to support having the #pragma at the start of any > > block inside a function? The effect

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-20 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. In D69272#1717021 , @kpn wrote: > Is there a way forward to support having the #pragma at the start of any > block inside a function? The effect won't be restricted to that block, true, > but the standard does say the #pragma is

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-11-05 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1068 + Warning<"in functions '#pragma STDC FENV_ACCESS ON' is supported only " + "in topmost block, ignoring pragma">, InGroup; "'#pragma STDC FENV_ACCESS ON'

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-11-04 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 227690. sepavloff added a comment. Removed diagnostics on inline functions As pointed out in review, strictfp attribute does not prevent from inlining, it only restrict cases where the inlining is possible. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Okay. If the optimizer cannot correctly handle a mix of constrained and unconstrained FP operations, then the optimizer should protect itself, either by refusing to inline across such boundaries or by adding constraints as necessary before inlining. If it does that,

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:890 + "cannot apply to inline functions, ignoring pragma">, + InGroup; sepavloff wrote: > hfinkel wrote: > > sepavloff wrote: > > > hfinkel wrote: > > > >

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked an inline comment as done. sepavloff added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:890 + "cannot apply to inline functions, ignoring pragma">, + InGroup; hfinkel wrote: > sepavloff wrote: > > hfinkel

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added a comment. > I don't see how such warning can help a user. A note about impact of the > pragma on performance can be put into documentation. Issuing a warning on > every use of the pragma may be annoying. I definitely agree. Performance may be fine in many cases, and performance

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In D69272#1717967 , @kpn wrote: > Baking into the front end the fact that the backend implementation is not yet > complete doesn't strike me as a good idea. I don't expect that this patch would pass review quickly. But it

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:890 + "cannot apply to inline functions, ignoring pragma">, + InGroup; sepavloff wrote: > hfinkel wrote: > > andrew.w.kaylor wrote: > > > rjmccall wrote: > > > >

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. Baking into the front end the fact that the backend implementation is not yet complete doesn't strike me as a good idea. And the metadata arguments to the constrained intrinsics are designed to allow for correctly marked constrained intrinsics to be eventually treated

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-22 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff marked an inline comment as done. sepavloff added a comment. Try to organize replies for better references. **Background** According to the current design, if floating point operations are represented by constrained intrinsics somewhere in a function, constrained intrinsics must be

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-21 Thread Hal Finkel via Phabricator via cfe-commits
hfinkel added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:890 + "cannot apply to inline functions, ignoring pragma">, + InGroup; andrew.w.kaylor wrote: > rjmccall wrote: > > What's the purpose of this restriction? Whether

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-21 Thread Andy Kaylor via Phabricator via cfe-commits
andrew.w.kaylor added a comment. Thanks for the patch! I don't have time to review this in detail this week, but I'm very happy to see this functionality. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:890 + "cannot apply to inline functions, ignoring pragma">,

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-21 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:890 + "cannot apply to inline functions, ignoring pragma">, + InGroup; What's the purpose of this restriction? Whether `inline` really has much to do with

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-21 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. Does this work for C++? C++ templates? I only see C tests. Is there a way forward to support having the #pragma at the start of any block inside a function? The effect won't be restricted to that block, true, but the standard does say the #pragma is allowed. Repository:

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-10-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. sepavloff added reviewers: rsmith, rjmccall, andrew.w.kaylor, kpn, hfinkel, cameron.mcinally, uweigand. Herald added a project: clang. This change implements support of '#pragma STDC FENV_ACCESS' in frontend. The pragma is supported only at namespace level and in