[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D72841#1917459 , @rjmccall wrote: > In D72841#1917340 , @mibintc wrote: > > > @rjmccall Since CompoundAssignmentOperator derives from BinaryOperator, > > it's not simple to add

RE: [PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-11 Thread Blower, Melanie I via cfe-commits
Sorry I don't understand. I have to add "final" onto BinaryOperator in order to use Trailing storage. But when I do that I can't derive CompoundAssignmentOperator from BinaryOperator. So I think I must fold these 2 classes together. Is there another way? > -Original Message- > From:

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D72841#1917340 , @mibintc wrote: > @rjmccall Since CompoundAssignmentOperator derives from BinaryOperator, it's > not simple to add Trailing storage here. I think I will have to fold > CompoundAssignmentOperator into

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-11 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. @rjmccall Since CompoundAssignmentOperator derives from BinaryOperator, it's not simple to add Trailing storage here. I think I will have to fold CompoundAssignmentOperator into BinaryOperator and then add the 2 extra fields needed by CompoundAssignmentOperator into

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-09 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D72841#1912416 , @mibintc wrote: > In D72841#1911330 , @rjmccall wrote: > > > In D72841#1908084 , @mibintc wrote: > > > > > @rjmccall suggested

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-09 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. In D72841#1911330 , @rjmccall wrote: > In D72841#1908084 , @mibintc wrote: > > > @rjmccall suggested that I needed to remove FPOptions from the Stmt class > > since the sizeof assertion

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-07 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In D72841#1908084 , @mibintc wrote: > @rjmccall suggested that I needed to remove FPOptions from the Stmt class > since the sizeof assertion failed. I moved that information into the relevant > expression nodes and fixed a few

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-05 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. I got an email like this "Harbormaster failed remote builds in B48237 : Diff 248536!" but there is no further information. It builds OK from my workstation. I did have to paste the review because an upload to Phabricator exceeded the

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-05 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 2 inline comments as done. mibintc added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4085 // this should improve codegen just a little. -RHS = Visit(E->getRHS()); -LHS = EmitCheckedLValue(E->getLHS(), CodeGenFunction::TCK_Store); +

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-04 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/AST/Stmt.h:1104 +static_assert(sizeof(*this) <= 16, "changing bitfields changed sizeof(Stmt)"); static_assert(sizeof(*this) % alignof(void *) == 0, mibintc wrote: >

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-04 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 12 inline comments as done. mibintc added a comment. Herald added a subscriber: rnkovacs. some inline replies and comments Comment at: clang/include/clang/AST/Stmt.h:1104 +static_assert(sizeof(*this) <= 16, "changing bitfields changed

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-03-01 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3055 +same spelling and syntax. For pragmas specified at file scope, a stack +is supported so that the pragma float_control settings can be pushed or popped. + `pragma float_control`

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-02-24 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 246285. mibintc marked an inline comment as done. mibintc added a comment. This patch is code complete and ready for your review and consideration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72841/new/

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-02-16 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 244894. mibintc added a comment. I found the problem in the #pragma float_control (push/pop) stack, it was just a dumb bug. I also added -include-pch test cases, and added code to ASTWriter ASTReader to preserve the floatcontrol pragma stack For 2 of the

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-02-11 Thread Melanie Blower via Phabricator via cfe-commits
mibintc added a comment. In D72841#1869931 , @lebedev.ri wrote: > I would think `contract` change can be separated from the rest of the > changes, and therefore should be a separate review (to reduce noise)? I split off that change to

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-02-11 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Herald added a subscriber: wuzish. I would think `contract` change can be separated from the rest of the changes, and therefore should be a separate review (to reduce noise)? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-02-11 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 243888. mibintc added a comment. Herald added subscribers: kbarton, jvesely, nemanjai. This patch is a work in progress. The problem that I want to work on next is that the scope is wrong when the pragma token is seen following the right brace of a function

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-30 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. You could check the scope where the pragma appears is the same way as `pragma clang fp` does. The code case tok::annot_pragma_fp: ProhibitAttributes(Attrs); Diag(Tok, diag::err_pragma_fp_scope); ConsumeAnnotationToken(); return StmtError(); is put

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-28 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 6 inline comments as done. mibintc added a comment. In D72841#1842772 , @andrew.w.kaylor wrote: > It's not clear to me from reading this how the "precise" control is going to > work with relation to the fast math flags. I don't think MSVC

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-27 Thread Andy Kaylor via Phabricator via cfe-commits
andrew.w.kaylor added a comment. It's not clear to me from reading this how the "precise" control is going to work with relation to the fast math flags. I don't think MSVC allows the granularity of control over these flags that we have in clang, so maybe they don't have this problem. Consider

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-27 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 240638. mibintc added a comment. rebase per @sepavloff request Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72841/new/ https://reviews.llvm.org/D72841 Files: clang/docs/LanguageExtensions.rst

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-27 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. Could you please rebase the patch against current master? The commit "4aea70ed3292 : [FPEnv] Extended FPOptions with new attributes" changed layout of FPOptions, which affects your patch.

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-24 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 3 inline comments as done. mibintc added a comment. In D72841#1833022 , @sepavloff wrote: > I don't see tests for correctness of the pragma stack (`pragma > float_control(... push)`, `pragma float_control(pop)`). Can you add them? I

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-24 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 240245. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72841/new/ https://reviews.llvm.org/D72841 Files: clang/docs/LanguageExtensions.rst clang/include/clang/AST/Stmt.h

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-22 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 2 inline comments as done. mibintc added a comment. A couple inline replies to @sepavloff ; I'll be uploading another revision. Comment at: clang/lib/Parse/ParsePragma.cpp:2537 +if (!Actions.CurContext->isTranslationUnit()) { +//FIXME this seems to be the

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-21 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. I don't see tests for correctness of the pragma stack (`pragma float_control(... push)`, `pragma float_control(pop)`). Can you add them? Comment at: clang/lib/Parse/ParsePragma.cpp:2537 +if (!Actions.CurContext->isTranslationUnit()) { +//FIXME

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-21 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 5 inline comments as done. mibintc added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:13129 if (FunctionDecl *F = dyn_cast(CurContext)) { + // If the expression occurs inside an internal global_var_init_function + // then the

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-21 Thread Melanie Blower via Phabricator via cfe-commits
mibintc updated this revision to Diff 239409. mibintc added a comment. Respond to review from @sepavloff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72841/new/ https://reviews.llvm.org/D72841 Files: clang/docs/LanguageExtensions.rst

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-21 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked an inline comment as done. mibintc added inline comments. Comment at: clang/lib/Parse/ParsePragma.cpp:2537 +if (!Actions.CurContext->isTranslationUnit()) { +//FIXME this seems to be the wrong way to check file-scope +//since the token immediately following a

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-20 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Parse/ParsePragma.cpp:2537 +if (!Actions.CurContext->isTranslationUnit()) { +//FIXME this seems to be the wrong way to check file-scope +//since the token immediately following a function definition

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-20 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 2 inline comments as done. mibintc added a comment. Added inline reply Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:111 // the corresponding enum in the IR. -static llvm::fp::RoundingMode ToConstrainedRoundingMD( +llvm::fp::RoundingMode

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:13129 if (FunctionDecl *F = dyn_cast(CurContext)) { + // If the expression occurs inside an internal global_var_init_function + // then the FunctionDecl is not availble

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-17 Thread Melanie Blower via Phabricator via cfe-commits
mibintc marked 3 inline comments as done. mibintc added a comment. @sepavloff Thanks a lot for your comments. I added a few replies and I have one question, added inline. Comment at: clang/lib/Parse/ParsePragma.cpp:2522 + IdentifierInfo *II = Tok.getIdentifierInfo(); +

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-16 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added inline comments. Comment at: clang/docs/LanguageExtensions.rst:3031 +The ``#pragma float_control`` pragma allows floating-point precision and +floating-point exception behavior to be specified Floating-point precision refers to the number of

[PATCH] D72841: [RFC] Add support for pragma float_control, to control precision and exception behavior at the source level

2020-01-16 Thread Melanie Blower via Phabricator via cfe-commits
mibintc created this revision. mibintc added reviewers: andrew.w.kaylor, kpn, rjmccall, sepavloff. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Intel would like to support #pragma float_control which allows control over precision and exception behavior