[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-23 Thread Bjorn Pettersson via Phabricator via cfe-commits
bjope added a comment. Looked around a bit. - Seems like in GNU libc they use an internal `__GLIBC_FLT_EVAL_METHOD` that is set to 2 if `__FLT_EVAL_METHOD__` is -1 (https://sourceware.org/git/?p=glibc.git;a=blob;f=bits/flt-eval-method.h;hb=f60e45ba10f0ca2794318de95720cdbdb6ff20d0). - In LLVM:

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-23 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added a comment. In D121122#3402442 , @aaron.ballman wrote: > In D121122#3402334 , @bjope wrote: > >> Hello. We've got some problem in our downstream tests after this patch and >> I'm trying to figure o

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-23 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D121122#3402334 , @bjope wrote: > Hello. We've got some problem in our downstream tests after this patch and > I'm trying to figure out how things are supposed to work. Maybe someone being > part of this review knows.

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-23 Thread Bjorn Pettersson via Phabricator via cfe-commits
bjope added a comment. Hello. We've got some problem in our downstream tests after this patch and I'm trying to figure out how things are supposed to work. Maybe someone being part of this review knows. Problem is that we have some libc verification suites that include test cases using `float_

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-17 Thread Zahira Ammarguellat via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbbf0d1932a3c: Currently the control of the eval-method is mixed with fast-math. (authored by zahiraam). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-17 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 416180. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAttr.cpp clang/t

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-17 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 416168. zahiraam marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. Please fix the clang format issue as well. Other than that and a nit, this LGTM. Comment at: clang/lib/Lex/PPMacroExpansion.cpp:1587 + // The `minus` opera

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 414739. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAttr.cpp clang/t

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added inline comments. Comment at: clang/test/CodeGen/eval-method-fast-math.c:113-116 +#pragma float_control(precise, on) +int val2 = __FLT_EVAL_METHOD__; + } + return __FLT_EVAL_METHOD__; aaron.ballman wrote: > Shouldn't there be CHECK lines for t

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. It looks like there are some clang-format issues to handle as well. Comment at: clang/test/CodeGen/eval-method-fast-math.c:113-116 +#pragma float_control(precise, on) +int val2 = __FLT_EVAL_METHOD__; + } + return __FLT_EVAL_METHOD__; ---

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 414729. zahiraam marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/include/clang/Lex/Preprocessor.h clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/CodeGen/eval-method-fast-math.c:83 +#pragma float_control(pop) + +int getFPEvalMethod() { zahiraam wrote: > aaron.ballman wrote: > > What should happen in a case like this? > > ``` > > int whatever(float

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added inline comments. Comment at: clang/test/CodeGen/eval-method-fast-math.c:83 +#pragma float_control(pop) + +int getFPEvalMethod() { aaron.ballman wrote: > What should happen in a case like this? > ``` > int whatever(float a, float b, float c) { > #

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/CodeGen/eval-method-fast-math.c:83 +#pragma float_control(pop) + +int getFPEvalMethod() { What should happen in a case like this? ``` int whatever(float a, float b, float c) { #pragma float_control(pre

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 414461. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAttr.cpp clang/test/CodeGen/eval-method-fast-math.c Inde

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 414460. zahiraam marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAttr.cpp clang

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:258 + // Fast-math is enabled. + if (getLangOpts().AllowFPReassoc || getLangOpts().AllowRecip) +PP.setCurrentFPEvalMethod(SourceLocation(), zahiraam wrote: > aaron.ballman wrote: > > S

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added inline comments. Comment at: clang/lib/Sema/Sema.cpp:258 + // Fast-math is enabled. + if (getLangOpts().AllowFPReassoc || getLangOpts().AllowRecip) +PP.setCurrentFPEvalMethod(SourceLocation(), aaron.ballman wrote: > Shouldn't this be looking

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/Sema.cpp:258 + // Fast-math is enabled. + if (getLangOpts().AllowFPReassoc || getLangOpts().AllowRecip) +PP.setCurrentFPEvalMethod(SourceLocation(), Shouldn't this be looking at `getLangOpts().

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-09 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 414216. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAttr.cpp clang/test/CodeGen/eval-method-fast-math.c Inde

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-08 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam added inline comments. Comment at: clang/lib/Lex/PPMacroExpansion.cpp:1600 +} else { + OS << getTUFPEvalMethod(); + // __FLT_EVAL_METHOD__ expands to a simple numeric value. andrew.w.kaylor wrote: > It looks like you've got tabs in the code

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-08 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam updated this revision to Diff 413936. zahiraam marked 3 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121122/new/ https://reviews.llvm.org/D121122 Files: clang/lib/Lex/PPMacroExpansion.cpp clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaAttr.cpp clang

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-08 Thread Andy Kaylor via Phabricator via cfe-commits
andrew.w.kaylor added a comment. The fix for the eval_method crash should be moved to a separate patch. Otherwise, this looks good. I have only minor comments. Comment at: clang/lib/Lex/PPMacroExpansion.cpp:1600 +} else { + OS << getTUFPEvalMethod(); + // __FLT_E

[PATCH] D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled.

2022-03-07 Thread Zahira Ammarguellat via Phabricator via cfe-commits
zahiraam created this revision. zahiraam added reviewers: andrew.w.kaylor, aaron.ballman, thakis, rjmccall, fhahn. Herald added a project: All. zahiraam requested review of this revision. Herald added a project: clang. Currently the control of the eval-method is mixed with fast-math. FLT_EVAL_M