[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-06-05 Thread Serge Pavlov via cfe-commits
spavloff wrote: The discussion for the proposed mechanism is open here: https://discourse.llvm.org/t/rfc-calling-functions-if-pragma-fenv-round-is-present/79372 > > This change introduces macro ROUNDING_MODE, which is a string dependent on > > the constant rounding mode > > It expands to an

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-06-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/92699 >From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 19 May 2024 18:43:08 +0700 Subject: [PATCH 1/4] [clang] Macro for constant rounding mode MIME-Version: 1.0

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-27 Thread Serge Pavlov via cfe-commits
spavloff wrote: Thanks! I will commit it in a couple of day, if no additional feedback is provided. https://github.com/llvm/llvm-project/pull/92699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-24 Thread Serge Pavlov via cfe-commits
@@ -965,6 +965,16 @@ void Preprocessor::Lex(Token ) { LastTokenWasAt = Result.is(tok::at); --LexLevel; + if (Result.is(tok::l_brace)) { +CurlyBraceLevel++; + } else if (Result.is(tok::r_brace)) { +if (!RoundingPragmas.empty() && spavloff wrote:

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-24 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/92699 >From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 19 May 2024 18:43:08 +0700 Subject: [PATCH 1/3] [clang] Macro for constant rounding mode MIME-Version: 1.0

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-24 Thread Serge Pavlov via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o - | FileCheck %s spavloff wrote: Parsing pragma FENV_ROUND has been moved to the preprocessor. https://github.com/llvm/llvm-project/pull/92699

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-24 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/92699 >From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 19 May 2024 18:43:08 +0700 Subject: [PATCH 1/2] [clang] Macro for constant rounding mode MIME-Version: 1.0

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-20 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff ready_for_review https://github.com/llvm/llvm-project/pull/92699 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-20 Thread Serge Pavlov via cfe-commits
@@ -0,0 +1,55 @@ +// RUN: %clang_cc1 -emit-llvm -triple i386-linux -Wno-unknown-pragmas %s -o - | FileCheck %s spavloff wrote: No, this macro is managed by the code in Sema, because pragma FENV_ROUND is processed there. If only `-E` is specified,

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-19 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/92699 >From f8cd2539fb7f0388d7f3955f58b61b09da03bf0c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 19 May 2024 18:43:08 +0700 Subject: [PATCH] [clang] Macro for constant rounding mode MIME-Version: 1.0

[clang] [clang] Macro for constant rounding mode (PR #92699)

2024-05-19 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/92699 The forthcoming C standard defines pragma FENV_ROUND to support constant rounding mode. It also requires some functions to be evaluated with such mode, N3096 7.6.2p4 states: Within the scope of an

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-16 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-16 Thread Serge Pavlov via cfe-commits
spavloff wrote: > The changes should come with a release note so that users know about the > behavioral change, but otherwise LGTM. Pragma FENV_ROUND is still officially unsupported, compiler issues a warning about this. It is https://github.com/llvm/llvm-project/pull/89617 that makes

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-15 Thread Serge Pavlov via cfe-commits
spavloff wrote: Are there any other comments? Can this PR be considered as approved? https://github.com/llvm/llvm-project/pull/90877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-15 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/92146 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-14 Thread Serge Pavlov via cfe-commits
@@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -emit-pch -DHEADER -x c++-header %s -o %t.pch +// RUN: %clang_cc1 -emit-llvm -include-pch %t.pch %s -o /dev/null + +#ifdef HEADER +__attribute__((optnone)) void foo() {} +#endif spavloff wrote: It is to avoid redefinition

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-14 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/92146 >From 4f6f0acb47d21b25e4e86733a81d609f4de7dc3c Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Tue, 14 May 2024 23:11:21 +0700 Subject: [PATCH 1/2] [clang] Store FPOptions earlier when parsing function After

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-05-14 Thread Serge Pavlov via cfe-commits
spavloff wrote: PR https://github.com/llvm/llvm-project/pull/92146 does not solve the problem of serialization mentioned above, but it is simple and quick solution for the reported crash. https://github.com/llvm/llvm-project/pull/85605 ___

[clang] [clang] Store FPOptions earlier when parsing function (PR #92146)

2024-05-14 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/92146 After https://github.com/llvm/llvm-project/pull/85605 ([clang] Set correct FPOptions if attribute 'optnone' presents) the current FP options in Sema are saved during parsing function because Sema can modify

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-05-13 Thread Serge Pavlov via cfe-commits
spavloff wrote: Hi @SLTozer, Thank you for the report. There is an issue somewhere around the code that reads/wtites records FP_PRAGMA_OPTIONS and/or FLOAT_CONTROL_PRAGMA_OPTIONS, which sometimes manifest itseld in broken synchronization of FP options. I will prepare fix soon.

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-05-13 Thread Serge Pavlov via cfe-commits
spavloff wrote: > 7.6.2p4 does clearly state that floating constants need to be evaluated > according to the standard rounding mode, so that the constant 0.1 evaluates > to a different value in FE_DOWNWARD versus FE_UPWARD. Treatment of floating-point constants is fixed in

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-05-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff edited https://github.com/llvm/llvm-project/pull/89617 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-05-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/89617 >From ec8838685fb7af618445c3ff1bae953778996c37 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 14 Apr 2022 18:00:14 +0700 Subject: [PATCH 1/3] Implementation of '#pragma STDC FENV_ROUND' This pragma is

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-06 Thread Serge Pavlov via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD spavloff wrote: Explicit

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-06 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 01/10] [clang] Use constant rounding mode for floating literals

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-06 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/91061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-05 Thread Serge Pavlov via cfe-commits
@@ -968,10 +968,7 @@ class FPOptionsOverride { setAllowFPContractAcrossStatement(); } - void setDisallowOptimizations() { -setFPPreciseEnabled(true); -setDisallowFPContract(); - } + void setDisallowOptimizations() { setFPPreciseEnabled(true); }

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/8] [clang] Use constant rounding mode for floating literals

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/91061 >From 32c0ec8a03b0c669dc595894730dd6f8a7933dea Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sat, 4 May 2024 12:26:22 +0700 Subject: [PATCH 1/2] [clang] Enable FPContract with optnone Previously treatment

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-05-04 Thread Serge Pavlov via cfe-commits
spavloff wrote: Hi @wjristow, Thank you for your detailed analysis. Indeed, FPContract looks more like mandatory option rather than optional optimization. I prepared PR: https://github.com/llvm/llvm-project/pull/91061, which fixes this issue. https://github.com/llvm/llvm-project/pull/85605

[clang] [clang] Enable FPContract with optnone (PR #91061)

2024-05-04 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/91061 Previously treatment of the attribute `optnone` was modified in https://github.com/llvm/llvm-project/pull/85605 ([clang] Set correct FPOptions if attribute 'optnone' presents). As a side effect FPContract was

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/7] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD spavloff wrote: > Does the

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
@@ -79,3 +79,16 @@ float V7 = []() -> float { 0x0.01p0F); }(); // CHECK: @V7 = {{.*}} float 1.00e+00 + +template struct L { + constexpr L() : value(V) {} + float value; +}; + +#pragma STDC FENV_ROUND FE_DOWNWARD spavloff wrote: In this snippet

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/5] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/4] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/90877 >From 5d906b537636ca0d8706a8a888dd78edfbec684f Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 2 May 2024 22:28:05 +0700 Subject: [PATCH 1/2] [clang] Use constant rounding mode for floating literals

[clang] [clang] Use constant rounding mode for floating literals (PR #90877)

2024-05-02 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/90877 Conversion of floating-point literal to binary representation must be made using constant rounding mode, which can be changed using pragma FENV_ROUND. For example, the literal "0.1F" should be representes by

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-25 Thread Serge Pavlov via cfe-commits
spavloff wrote: Hi @dyung. The observed difference is due to the FP contraction turned off if optnone is specified. In O0 this optimization is still applied. As a result, the function with optnone contains separate fadd and fmul, while without this attribute the function contains combined

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-25 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/89617 >From 0fc5c57264ecf51f8b9fe8303520a51cb1fee40e Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 14 Apr 2022 18:00:14 +0700 Subject: [PATCH 1/2] Implementation of '#pragma STDC FENV_ROUND' This pragma is

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-23 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/89617 >From 0fc5c57264ecf51f8b9fe8303520a51cb1fee40e Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 14 Apr 2022 18:00:14 +0700 Subject: [PATCH] Implementation of '#pragma STDC FENV_ROUND' This pragma is

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-23 Thread Serge Pavlov via cfe-commits
spavloff wrote: Thanks! > Is there any existing bookkeeping we no longer need to do if we're going to > have this RAII object in scope during function parsing? It seems handling fast-math is the only case that prevented using this RAII object. https://github.com/llvm/llvm-project/pull/85605

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-23 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/85605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-22 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/89617 >From fc7aab600c25b39b2df039c0cbcf517719736311 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Thu, 14 Apr 2022 18:00:14 +0700 Subject: [PATCH] Implementation of '#pragma STDC FENV_ROUND' This pragma is

[clang] Implementation of '#pragma STDC FENV_ROUND' (PR #89617)

2024-04-22 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/89617 This pragma is introduced by forthcoming C2x standard and can be used to set particular rounding mode without need to call 'fesetmode' or accessing control mode registers directly. Previously this pragma was

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-22 Thread Serge Pavlov via cfe-commits
spavloff wrote: A little about the significance of this fix. To implement pragma FENV_ROUND, we need to apply the FP options stored in the instance of CompoundStmt to the builder object, so that it uses the specified rounding mode. It can be done using the class CGFPOptionsRAII. However in

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-15 Thread Serge Pavlov via cfe-commits
spavloff wrote: Ping. https://github.com/llvm/llvm-project/pull/85605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-04-15 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 07e171e0566ab584299a57c210106bb8220c6261 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH 1/4] [clang] Set correct FPOptions if attribute 'optnone'

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-24 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 5049e0209e240f0f8a3ccb6e248d55d1480b7bad Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH 1/4] [clang] Set correct FPOptions if attribute 'optnone'

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-20 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 5049e0209e240f0f8a3ccb6e248d55d1480b7bad Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH 1/2] [clang] Set correct FPOptions if attribute 'optnone'

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-20 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 5049e0209e240f0f8a3ccb6e248d55d1480b7bad Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH 1/2] [clang] Set correct FPOptions if attribute 'optnone'

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-19 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff ready_for_review https://github.com/llvm/llvm-project/pull/85605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-19 Thread Serge Pavlov via cfe-commits
spavloff wrote: > optnone is a very strange attribute; it's a directive to the compiler with no > clear semantics. `fast-math` also does not have clear semantics. It is however used to express user's expectations that some assumptions are valid. `optnone` could also be treated from similar

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-18 Thread Serge Pavlov via cfe-commits
spavloff wrote: > Hmm. Is there some sort of optimization in IRGen that we need to suppress > here, or is it something in LLVM code gen? Presumably normal LLVM > optimization passes all just skip `optnone` functions. The issue https://github.com/llvm/llvm-project/issues/62098 demonstrates

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-18 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/85605 >From 5049e0209e240f0f8a3ccb6e248d55d1480b7bad Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 18 Mar 2024 13:20:15 +0700 Subject: [PATCH] [clang] Set correct FPOptions if attribute 'optnone' presents

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-18 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff converted_to_draft https://github.com/llvm/llvm-project/pull/85605 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Set correct FPOptions if attribute 'optnone' presents (PR #85605)

2024-03-18 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/85605 Attribute `optnone` must turn off all optimizations including fast-math ones. Actually AST nodes in the 'optnone' function still had fast-math flags. This change implements fixing FP options before function

[clang-tools-extra] [llvm] [clang] [GlobalISel][ARM] Legalze set_fpenv and get_fpenv (PR #79852)

2024-02-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/79852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clang] [GlobalISel][ARM] Legalze set_fpenv and get_fpenv (PR #79852)

2024-02-03 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/79852 >From b0cd3a40ecaac9ca49c7a0e697ecdbe2b6c899e2 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 29 Jan 2024 21:09:40 +0700 Subject: [PATCH 1/2] [GlobalISel][ARM] Legalze set_fpenv and get_fpenv Implement

[clang] [clang] Use current rounding mode for float inc/dec (PR #73770)

2023-11-30 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/73770 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Use current rounding mode for float inc/dec (PR #73770)

2023-11-30 Thread Serge Pavlov via cfe-commits
@@ -4623,10 +4623,12 @@ struct IncDecSubobjectHandler { if (Old) *Old = APValue(Value); APFloat One(Value.getSemantics(), 1); +llvm::RoundingMode RM = +E->getFPFeaturesInEffect(Info.Ctx.getLangOpts()).getRoundingMode(); spavloff wrote:

[clang] [clang] Use current rounding mode for float inc/dec (PR #73770)

2023-11-30 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/73770 >From 48ed25acfa5765af607efce2309605b96a09d477 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 29 Nov 2023 00:53:54 +0700 Subject: [PATCH 1/2] [clang] Use current rounding mode for float inc/dec

[clang] [clang] Use current rounding mode for float inc/dec (PR #73770)

2023-11-29 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/73770 Increment and decrement are equivalent to adding or subtracting 1. For the floating-point values these operations depend on the current rounding mode. Teach constant evaluator to perform ++ and -- according to

[clang] [llvm] [clang-tools-extra] [PowerPC] Implement llvm.set.rounding intrinsic (PR #67302)

2023-11-28 Thread Serge Pavlov via cfe-commits
spavloff wrote: LGTM. https://github.com/llvm/llvm-project/pull/67302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [PowerPC] Implement llvm.set.rounding intrinsic (PR #67302)

2023-11-23 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff edited https://github.com/llvm/llvm-project/pull/67302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [PowerPC] Implement llvm.set.rounding intrinsic (PR #67302)

2023-11-23 Thread Serge Pavlov via cfe-commits
@@ -8900,6 +8900,83 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op, return FP; } +SDValue PPCTargetLowering::LowerSET_ROUNDING(SDValue Op, + SelectionDAG ) const { + SDLoc Dl(Op); + MachineFunction =

[clang-tools-extra] [llvm] [PowerPC] Implement llvm.set.rounding intrinsic (PR #67302)

2023-11-23 Thread Serge Pavlov via cfe-commits
@@ -8900,6 +8900,83 @@ SDValue PPCTargetLowering::LowerINT_TO_FP(SDValue Op, return FP; } +SDValue PPCTargetLowering::LowerSET_ROUNDING(SDValue Op, + SelectionDAG ) const { + SDLoc Dl(Op); + MachineFunction =

[clang-tools-extra] [llvm] [PowerPC] Implement llvm.set.rounding intrinsic (PR #67302)

2023-11-23 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff commented: The patch looks good but I am not familiar with PPC instructions enough. Could you please run the runtime tests from here: https://github.com/llvm/llvm-test-suite/tree/main/MultiSource/UnitTests/Float/rounding? You just need to build application from two

[clang-tools-extra] [llvm] [PowerPC] Implement llvm.set.rounding intrinsic (PR #67302)

2023-11-23 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff edited https://github.com/llvm/llvm-project/pull/67302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] fix test PR69717.cpp (PR #72134)

2023-11-13 Thread Serge Pavlov via cfe-commits
spavloff wrote: @antmox Thank you for fixing that! LGTM. Could you please commit the patch when tests pass? https://github.com/llvm/llvm-project/pull/72134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-13 Thread Serge Pavlov via cfe-commits
spavloff wrote: Added commit: https://github.com/llvm/llvm-project/commit/93ae26331592f41bf2b1d10b048743d80c468385 to run the test on x86 only. https://github.com/llvm/llvm-project/pull/70646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] 93ae263 - [clang] Run test on x86 only

2023-11-13 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-11-13T19:20:34+07:00 New Revision: 93ae26331592f41bf2b1d10b048743d80c468385 URL: https://github.com/llvm/llvm-project/commit/93ae26331592f41bf2b1d10b048743d80c468385 DIFF: https://github.com/llvm/llvm-project/commit/93ae26331592f41bf2b1d10b048743d80c468385.diff

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/70646 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-13 Thread Serge Pavlov via cfe-commits
@@ -710,9 +710,11 @@ class Sema final { return result; } + // Saves the current floating-point pragma stack and clear it in this Sema. class FpPragmaStackSaveRAII { public: -FpPragmaStackSaveRAII(Sema ) : S(S), SavedStack(S.FpPragmaStack) {} +

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/70646 >From e1623db8f86a8584d17729f000a455f5672adad4 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 30 Oct 2023 14:38:50 +0700 Subject: [PATCH 1/3] [clang] Do not clear FP pragma stack when instantiating

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/70646 >From 7882ea746ecf8721356fc6afbd7798b8db4e185d Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 30 Oct 2023 14:38:50 +0700 Subject: [PATCH 1/3] [clang] Do not clear FP pragma stack when instantiating

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/70646 >From 7882ea746ecf8721356fc6afbd7798b8db4e185d Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Mon, 30 Oct 2023 14:38:50 +0700 Subject: [PATCH 1/2] [clang] Do not clear FP pragma stack when instantiating

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-11-09 Thread Serge Pavlov via cfe-commits
spavloff wrote: `pragma pack` uses pragma stack and it is allowed in any place: https://godbolt.org/z/f8fP1vn63 . If such pragma presents in the late-parsed template, and push-pop operations in it are not balanced, the late parse of such function can break the pragma stack and next templates

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-31 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff closed https://github.com/llvm/llvm-project/pull/69041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-31 Thread Serge Pavlov via cfe-commits
spavloff wrote: Thanks! https://github.com/llvm/llvm-project/pull/69041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-10-31 Thread Serge Pavlov via cfe-commits
spavloff wrote: Late parsing (in contrast to template instantiation) is sensitive to the pragma stack because the late parsed text may contain pragmas. If, for example, the parsed text contains unbalanced pus/pop pragmas, it is detected if the pragma stack is empty, but can be missed if there

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-10-30 Thread Serge Pavlov via cfe-commits
spavloff wrote: Actually the pragma stack is not saved during template instantiation. It is saved during late template parsing using class `FpPragmaStackSaveRAII`. For template instantiation the dependency on the stack can be considered as an error, because all information about FP options

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-10-30 Thread Serge Pavlov via cfe-commits
spavloff wrote: > To be clear, we're still ensuring the current pragma state during > instantiation is what it was when the template is parsed, we're just not > incorrectly dropping all of the saved pragma state when we're doing it? Yes, the pragma is used at parse stage to set correct FP

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-30 Thread Serge Pavlov via cfe-commits
spavloff wrote: Ping. https://github.com/llvm/llvm-project/pull/69041 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Do not clear FP pragma stack when instantiating functions (PR #70646)

2023-10-30 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/70646 When instantiation function, a call to Sema::resetFPOption was used to set the FP options associated with AST node. However this function also cleared FP pragma stack, and it is incorrect. Template

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-16 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/69041 >From 1374e323198d7188e688845eb951df4148a1dfd8 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 11 Oct 2023 14:27:26 +0700 Subject: [PATCH 1/5] [clang] Additional FP classification functions C language

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-15 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/69041 >From 1374e323198d7188e688845eb951df4148a1dfd8 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 11 Oct 2023 14:27:26 +0700 Subject: [PATCH 1/5] [clang] Additional FP classification functions C language

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-15 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/69041 >From 1374e323198d7188e688845eb951df4148a1dfd8 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 11 Oct 2023 14:27:26 +0700 Subject: [PATCH 1/4] [clang] Additional FP classification functions C language

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-15 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/69041 >From 1374e323198d7188e688845eb951df4148a1dfd8 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 11 Oct 2023 14:27:26 +0700 Subject: [PATCH 1/3] [clang] Additional FP classification functions C language

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-15 Thread Serge Pavlov via cfe-commits
@@ -494,6 +494,9 @@ BUILTIN(__builtin_isinf, "i.", "FnctE") BUILTIN(__builtin_isinf_sign, "i.", "FnctE") BUILTIN(__builtin_isnan, "i.", "FnctE") BUILTIN(__builtin_isnormal, "i.", "FnctE") +BUILTIN(__builtin_issubnormal,"i.", "FnctE") +BUILTIN(__builtin_iszero,

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-15 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff updated https://github.com/llvm/llvm-project/pull/69041 >From 1374e323198d7188e688845eb951df4148a1dfd8 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Wed, 11 Oct 2023 14:27:26 +0700 Subject: [PATCH 1/2] [clang] Additional FP classification functions C language

[clang] [clang] Additional FP classification functions (PR #69041)

2023-10-13 Thread Serge Pavlov via cfe-commits
https://github.com/spavloff created https://github.com/llvm/llvm-project/pull/69041 C language standard defined library functions `iszero`, `issignaling` and `issubnormal`, which did not have counterparts among clang builtin functions. This change adds new functions: __builtin_iszero

[clang] 9fd57e4 - [clang] Support vectors in __builtin_isfpclass

2023-09-01 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-09-02T11:52:43+07:00 New Revision: 9fd57e4d48881b0f395621bd4a7aa8ec54dc6729 URL: https://github.com/llvm/llvm-project/commit/9fd57e4d48881b0f395621bd4a7aa8ec54dc6729 DIFF: https://github.com/llvm/llvm-project/commit/9fd57e4d48881b0f395621bd4a7aa8ec54dc6729.diff

[clang] 8859c64 - [clang][test] Make check pattern shorter

2023-08-30 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-08-30T13:08:48+07:00 New Revision: 8859c644ede4898f90f77dcad2286de08a9ba62e URL: https://github.com/llvm/llvm-project/commit/8859c644ede4898f90f77dcad2286de08a9ba62e DIFF: https://github.com/llvm/llvm-project/commit/8859c644ede4898f90f77dcad2286de08a9ba62e.diff

[clang] 73e5a70 - [clang] Run test for concrete target

2023-08-21 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-08-21T13:23:06+07:00 New Revision: 73e5a70e676850b79f196e01e2194a2485041584 URL: https://github.com/llvm/llvm-project/commit/73e5a70e676850b79f196e01e2194a2485041584 DIFF: https://github.com/llvm/llvm-project/commit/73e5a70e676850b79f196e01e2194a2485041584.diff

[clang] 0baf85c - [clang] Set FP options in Sema when instantiating CompoundStmt

2023-08-20 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-08-21T12:36:41+07:00 New Revision: 0baf85c331090fbe2d2b42214ed0664d55feb0b5 URL: https://github.com/llvm/llvm-project/commit/0baf85c331090fbe2d2b42214ed0664d55feb0b5 DIFF: https://github.com/llvm/llvm-project/commit/0baf85c331090fbe2d2b42214ed0664d55feb0b5.diff

[clang] cc006ac - [clang] Fix delayed template parsing

2023-07-17 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-07-17T14:51:34+07:00 New Revision: cc006acdd6d7280a85c63fe375a4c9d1738e3fcd URL: https://github.com/llvm/llvm-project/commit/cc006acdd6d7280a85c63fe375a4c9d1738e3fcd DIFF: https://github.com/llvm/llvm-project/commit/cc006acdd6d7280a85c63fe375a4c9d1738e3fcd.diff

[clang] fde5924 - [clang] Reset FP options before template instantiation

2023-07-12 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-07-13T11:49:00+07:00 New Revision: fde5924dcc69fe814085482df259b8cfee236f2c URL: https://github.com/llvm/llvm-project/commit/fde5924dcc69fe814085482df259b8cfee236f2c DIFF: https://github.com/llvm/llvm-project/commit/fde5924dcc69fe814085482df259b8cfee236f2c.diff

[clang] 7d6c2e1 - [clang] Use llvm.is_fpclass to implement FP classification functions

2023-07-11 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-07-11T21:34:53+07:00 New Revision: 7d6c2e18114de9900d1b012cf9c219803b183f63 URL: https://github.com/llvm/llvm-project/commit/7d6c2e18114de9900d1b012cf9c219803b183f63 DIFF: https://github.com/llvm/llvm-project/commit/7d6c2e18114de9900d1b012cf9c219803b183f63.diff

[clang] d4a5673 - [AIX][clang][tests] XFail PCH/late-parsed-instantiations.cpp

2023-07-06 Thread Serge Pavlov via cfe-commits
Author: Serge Pavlov Date: 2023-07-06T14:06:30+07:00 New Revision: d4a5673addd69aa2a299d9de4db8d17373be URL: https://github.com/llvm/llvm-project/commit/d4a5673addd69aa2a299d9de4db8d17373be DIFF: https://github.com/llvm/llvm-project/commit/d4a5673addd69aa2a299d9de4db8d17373be.diff

  1   2   3   4   >