[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-19 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/100453 >From cf7bf482e7ce11f0ca1add4b0bb62a327ac56b71 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 19 Apr 2024 15:34:03 -0700 Subject: [PATCH 1/4] [Driver] Introduce ffp-model=aggressive This change modifi

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-19 Thread Fangrui Song via cfe-commits
MaskRay wrote: > > > @MaskRay Are you OK with this change? > > > > > > Sorry for the delay. I've read through > > [discourse.llvm.org/t/making-ffp-model-fast-more-user-friendly/78402](https://discourse.llvm.org/t/making-ffp-model-fast-more-user-friendly/78402), > > how we ended up with `-ffp-

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-19 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > > @MaskRay Are you OK with this change? > > Sorry for the delay. I've read through > https://discourse.llvm.org/t/making-ffp-model-fast-more-user-friendly/78402, > how we ended up with `-ffp-contract=fast-honor-pragmas` beside `=fast` (GCC > compatibility, sigh), some note

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-19 Thread Andy Kaylor via cfe-commits
@@ -163,23 +183,41 @@ // CHECK-FEB-IGNORE: "-fno-rounding-math" // CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore" -// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=fast -c %s 2>&1 \ +// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=aggressive -c %s

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
MaskRay wrote: > @MaskRay Are you OK with this change? Sorry for the delay. I've read through https://discourse.llvm.org/t/making-ffp-model-fast-more-user-friendly/78402, how we ended up with `-ffp-contract=fast-honor-pragmas` beside `=fast` (GCC compatibility, sigh), some notes that ICC/GCC

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
@@ -163,23 +183,41 @@ // CHECK-FEB-IGNORE: "-fno-rounding-math" // CHECK-FEB-IGNORE: "-ffp-exception-behavior=ignore" -// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=fast -c %s 2>&1 \ +// RUN: %clang -### -nostdinc -Werror -ffast-math -ffp-model=aggressive -c %s

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
@@ -109,20 +112,37 @@ // CHECK-TRAP: "-cc1" // CHECK-TRAP: "-ffp-exception-behavior=strict" +// RUN: %clang -### -nostdinc -ffp-model=aggressive -c %s 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-FPM-AGGR %s +// CHECK-FPM-AGGR: "-cc1" +// CHECK-FPM-AGGR: "-menable-no-inf

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
@@ -3033,8 +3039,8 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, SignedZeros = true; StringRef Val = A->getValue(); - if (OFastEnabled && Val != "fast") { -// Only -ffp-model=fast is compatible with OFast, ignore. +

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. fp-model= => -ffp-model= LGTM. I expect that the subject explicit mentions -ffp-model=fast behavior difference, even if it becomes less aggressive and unlikely breaks users. With "Introduce ...", nobody would expect behavior differences.

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
@@ -2879,10 +2879,31 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, std::string ComplexRangeStr = ""; std::string GccRangeComplexOption = ""; + auto setComplexRange = [&](LangOptions::ComplexRangeKind NewRange) { +// Warn if user expe

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
@@ -2,13 +2,13 @@ // and other floating point options get a warning diagnostic. // -// RUN: %clang -### -ffp-model=fast -ffp-contract=off -c %s 2>&1 \ +// RUN: %clang -### -ffp-model=aggressive -ffp-contract=off -c %s 2>&1 \ MaskRay wrote: It's still useful t

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-17 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/100453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-15 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @MaskRay Are you OK with this change? https://github.com/llvm/llvm-project/pull/100453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-13 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @kpneal I think the tolerance of excess precision is mostly a concession to the hardware limitations. I believe we only apply it when half-precision types are used but the hardware doesn't support native half-precision operations. In this sense, it is equivalent to the situat

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-12 Thread Kevin P. Neal via cfe-commits
kpneal wrote: Since you asked about "=strict", I don't think the strict model should change handling of excess precision. The rounding part of the constrained intrinsics shouldn't have any effect at all on excess precision. Eliminating excess precision also shouldn't happen with exception hand

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-08-07 Thread Andy Kaylor via cfe-commits
andykaylor wrote: @MaskRay @jyknight @jcranmer-intel Any more comments on this? https://github.com/llvm/llvm-project/pull/100453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-30 Thread Andy Kaylor via cfe-commits
andykaylor wrote: Providing a bit more context here, the change to remove the finite-math-only assumption from `-ffp-model=fast` is intended to avoid problems like https://github.com/llvm/llvm-project/issues/69089. In that case, more aggressive optimizations based on the `ninf` fast-math flag

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-30 Thread Aaron Ballman via cfe-commits
@@ -102,6 +102,16 @@ Deprecated Compiler Flags Modified Compiler Flags --- +- The ``-ffp-model`` option has been updated to enable a more limited set of + optimizations when the ``fast`` argument is used and to accept a new argument, + ``aggressive``. Th

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-29 Thread Andy Kaylor via cfe-commits
@@ -102,6 +102,16 @@ Deprecated Compiler Flags Modified Compiler Flags --- +- The ``-ffp-model`` option has been updated to enable a more limited set of + optimizations when the ``fast`` argument is used and to accept a new argument, + ``aggressive``. Th

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-29 Thread Aaron Ballman via cfe-commits
@@ -102,6 +102,16 @@ Deprecated Compiler Flags Modified Compiler Flags --- +- The ``-ffp-model`` option has been updated to enable a more limited set of + optimizations when the ``fast`` argument is used and to accept a new argument, + ``aggressive``. Th

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-25 Thread Andy Kaylor via cfe-commits
andykaylor wrote: FWIW, here is a comparison of clang to the two other non-LLVM-based compilers I'm aware of that implement an option equivalent to `-ffp-model=fast` https://godbolt.org/z/anjs78bj1 https://github.com/llvm/llvm-project/pull/100453 ___

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-25 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > It seems a bit confusing to me to create a situation where `-ffast-math` is > equivalent to `-ffp-model=aggressive`, not `-ffp-model=fast`. I can understand that, but the problem I'm trying to fix is that the naming of fast-math options we inherited from gcc is counter-intu

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-25 Thread James Y Knight via cfe-commits
jyknight wrote: It seems a bit confusing to me to create a situation where `-ffast-math` is equivalent to `-ffp-model=aggressive`, not `-ffp-model=fast`. https://github.com/llvm/llvm-project/pull/100453 ___ cfe-commits mailing list cfe-commits@lists.l

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor updated https://github.com/llvm/llvm-project/pull/100453 >From cf7bf482e7ce11f0ca1add4b0bb62a327ac56b71 Mon Sep 17 00:00:00 2001 From: Andy Kaylor Date: Fri, 19 Apr 2024 15:34:03 -0700 Subject: [PATCH 1/2] [Driver] Introduce ffp-model=aggressive This change modifi

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Andy Kaylor via cfe-commits
andykaylor wrote: > Should include a driver test with an offload language to see it gets applied > to both compiles I think that's a good idea, but I don't think it's directly related to this PR. https://github.com/llvm/llvm-project/pull/100453 ___ c

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Zahira Ammarguellat via cfe-commits
@@ -102,6 +102,17 @@ Deprecated Compiler Flags Modified Compiler Flags --- +- The ``-ffp-model`` option has been updated to enable a more limited set of + optimizations when the ``fast`` argument is used and to accept a new argument, + ``aggressive``. Th

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Joshua Cranmer via cfe-commits
@@ -1766,7 +1768,10 @@ for more details. ``STDC FENV_ACCESS``: by default ``FENV_ACCESS`` is disabled. This option setting behaves as though ``#pragma STDC FENV_ACCESS ON`` appeared at the top of the source file. - * ``fast`` Behaves identically to specifying b

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Joshua Cranmer via cfe-commits
@@ -3033,8 +3038,8 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D, SignedZeros = true; StringRef Val = A->getValue(); - if (OFastEnabled && Val != "fast") { -// Only -ffp-model=fast is compatible with OFast, ignore. +

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Matt Arsenault via cfe-commits
https://github.com/arsenm commented: Should include a driver test with an offload language to see it gets applied to both compiles https://github.com/llvm/llvm-project/pull/100453 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 2e3ee31d2901bd1faeb57703992358130d5f2dcc cf7bf482e7ce11f0ca1add4b0bb62a327ac56b71 --e

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Andy Kaylor (andykaylor) Changes This change modifies -ffp-model=fast to select options that more closely match -funsafe-math-optimizations, and introduces a new model, -ffp-model=aggressive which matches the existing behavior (except for a

[clang] [Driver] Introduce ffp-model=aggressive (PR #100453)

2024-07-24 Thread Andy Kaylor via cfe-commits
https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/100453 This change modifies -ffp-model=fast to select options that more closely match -funsafe-math-optimizations, and introduces a new model, -ffp-model=aggressive which matches the existing behavior (except for a m