@@ -271,30 +271,32 @@
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
// RUN: %clang -### -funsafe-math-optimizations -fno-reciprocal-math -c %s \
-// RUN: 2>&1 | FileCheck --check-prefix=CHECK-NO-UNSAFE-MATH %s
+// RUN: 2>&1 | FileCheck --check-prefix=CH
@@ -318,12 +320,12 @@
// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
// RUN: -fno-trapping-math -ftrapping-math -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-NO-REASSOC-NO-UNSAFE-MATH %s
+// RUN: | FileCheck --check-prefix=CHECK-N
andykaylor wrote:
> This effort is highly desirable, c.f. this [blog
> post](https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html),
> so thanks for that!
>
> Xref: #57589, #80475, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55522
My patch here still leaves the pro
@@ -318,12 +320,12 @@
// RUN: %clang -### -fassociative-math -freciprocal-math -fno-signed-zeros \
// RUN: -fno-trapping-math -ftrapping-math -c %s 2>&1 \
-// RUN: | FileCheck --check-prefix=CHECK-NO-REASSOC-NO-UNSAFE-MATH %s
+// RUN: | FileCheck --check-prefix=CHECK-N
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89473
>From 100fc9dfb2b071877d758ce71bddeec693d986da Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 16:35:00 -0700
Subject: [PATCH 1/2] Fix -fno-unsafe-math-optimizations behavior
This changes th
andykaylor wrote:
I've made some minor changes to clean up the LIT test checks for this PR. I
started to clean up the entire test, but it quickly became obvious that I
should put that into a separate PR.
I will submit a new PR to clean up the entire fast-math.c test. I have an idea
that I thi
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/89687
- Fix -fno-unsafe-math-optimizations behavior
- [WIP] Major change to fast-math.c lit test
- Clean up the checks in the fast-math driver test
>From 100fc9dfb2b071877d758ce71bddeec693d986da Mon Sep 17 00:00:00
andykaylor wrote:
I've made extensive changes to the fast-math.c test here:
https://github.com/llvm/llvm-project/pull/89687
That update isn't intended to change any existing behavior. A few things worked
differently than I expected, but I left the checks consistent with the current
behavior a
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/99723
>From 869385fd8d7738b041149d88d5f427b5039c5921 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 6 May 2024 10:07:52 -0700
Subject: [PATCH 1/3] [Driver] Clean up fp-contract handling in clang driver
This
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/99723
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/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
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
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
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
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
___
@@ -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
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
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/99723
This change refactors the fp-contract handling in
RenderFloatingPointOptions in the clang driver code and fixes some
inconsistencies in the way warnings are reported for changes in the
fp-contract behavior.
>
andykaylor wrote:
This is a refreshed version of https://github.com/llvm/llvm-project/pull/91271.
Given how long it's been since I updated that PR, it seemed better to just
start fresh.
https://github.com/llvm/llvm-project/pull/99723
___
cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/99723
>From 869385fd8d7738b041149d88d5f427b5039c5921 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 6 May 2024 10:07:52 -0700
Subject: [PATCH 1/2] [Driver] Clean up fp-contract handling in clang driver
This
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/91271
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
andykaylor wrote:
> I think this works for the test. I'm slightly confused by the PR not-stacking
> with the test changes on top of the other PR
That's user error on my part. There are commits here that I didn't intend to be
part of this PR. I'll clean it up before I submit it.
https://github
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89687
>From 8c23afa9fd069fece39f3fa7a913d93aee082c77 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Tue, 23 Apr 2024 14:29:00 -0700
Subject: [PATCH] Clean up the checks in the fast-math driver test
This change re
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/89687
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -842,25 +842,6 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList
&Args,
ToolChain::addProfileRTLibs(Args, CmdArgs);
}
-llvm::DenormalMode
-Linux::getDefaultDenormalModeForType(const llvm::opt::ArgList &DriverArgs,
- const JobAct
https://github.com/andykaylor approved this pull request.
https://github.com/llvm/llvm-project/pull/80475
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89473
>From a137c023aaf5ccc174d347b7bda403bf15d683ae Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Wed, 24 Apr 2024 12:35:49 -0700
Subject: [PATCH] Fix -fno-unsafe-math-optimizations behavior
This changes the ha
@@ -842,25 +842,6 @@ void Linux::addProfileRTLibs(const llvm::opt::ArgList
&Args,
ToolChain::addProfileRTLibs(Args, CmdArgs);
}
-llvm::DenormalMode
-Linux::getDefaultDenormalModeForType(const llvm::opt::ArgList &DriverArgs,
- const JobAct
andykaylor wrote:
This patch will need extensive changes once
https://github.com/llvm/llvm-project/pull/80475 lands. We're basically
decoupling "denormal-fp-math" from fast-math, but I think we still want to link
"crtfastmath.o" when --fp-model=fast is used, as we do with -ffast-math.
https:/
andykaylor wrote:
> One final nit before you submit, though: please update the PR description and
> the release notes to also mention that x86 no longer modifies
> `-fdenormal-fp-math` based on `-ffast-math`.
The Clang User's Manual makes some contradictory statements about this. In one
place
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89477
>From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 17:53:52 -0700
Subject: [PATCH 1/3] Clean up denormal handling with -ffp-model, -ffast-math,
et
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/89477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/89477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
andykaylor wrote:
I've updated this change to account for the changes made in
https://github.com/llvm/llvm-project/pull/80475 and made corresponding updated
to the PR title and description.
https://github.com/llvm/llvm-project/pull/89477
___
cfe-comm
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89477
>From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 17:53:52 -0700
Subject: [PATCH 1/4] Clean up denormal handling with -ffp-model, -ffast-math,
et
@@ -1314,11 +1314,17 @@ bool ToolChain::isFastMathRuntimeAvailable(const
ArgList &Args,
Arg *A =
Args.getLastArg(options::OPT_ffast_math, options::OPT_fno_fast_math,
options::OPT_funsafe_math_optimizations,
- options::OPT_fn
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89477
>From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 17:53:52 -0700
Subject: [PATCH 1/5] Clean up denormal handling with -ffp-model, -ffast-math,
et
@@ -75,6 +76,7 @@
// RUN: --check-prefix=WARN12 %s
// RUN: %clang -### -ffast-math -ffp-model=strict -c %s 2>&1 | FileCheck \
// RUN: --check-prefix=WARN12 %s
+// WARN12: clang
andykaylor wrote:
The only purpose of the check here is to establish a referenc
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89477
>From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 17:53:52 -0700
Subject: [PATCH 1/6] Clean up denormal handling with -ffp-model, -ffast-math,
et
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89477
>From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 17:53:52 -0700
Subject: [PATCH 1/7] Clean up denormal handling with -ffp-model, -ffast-math,
et
andykaylor wrote:
> LGTM. May be no need for the "etc" in the title of the patch? Thanks.
The "etc." is eliding -fno-fast-math, -funsafe-math-optimizations, and
-fno-unsafe-math-optimizations
https://github.com/llvm/llvm-project/pull/89477
___
cfe-co
@@ -64,7 +64,8 @@
// RUN: %clang -### -ffp-model=strict
-fdenormal-fp-math=preserve-sign,preserve-sign -c %s 2>&1 \
andykaylor wrote:
I didn't intend to change the logic of this test. The behavior here should be
target-independent now.
https://github.com/ll
https://github.com/andykaylor approved this pull request.
This looks right to me, but @zahiraam is more familiar with this code than I
am. Zahira, do you have any comments?
https://github.com/llvm/llvm-project/pull/90377
___
cfe-commits mailing list
c
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/89477
>From 8ab931c4506f08685758a58f4cf7974c5254c3fa Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 19 Apr 2024 17:53:52 -0700
Subject: [PATCH 1/8] Clean up denormal handling with -ffp-model, -ffast-math,
et
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/89477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/89477
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor reopened
https://github.com/llvm/llvm-project/pull/105746
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/105746
>From 973e7fb1a09f5479f88616e19642a71edc977b4a Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Thu, 22 Aug 2024 15:35:07 -0700
Subject: [PATCH 1/2] Honor pragmas with -ffp-contract=fast, depecate
fast-honor
andykaylor wrote:
This may not be as bad as I thought. After looking more closely at the one test
case that was failing with this change, it turned out that the failure was
happening because the test contained a pragma to turn contraction off but
checks to verify that the fma was generated any
@@ -218,28 +214,31 @@ _Complex float pragma_default_div(_Complex float a,
_Complex float b) {
// IMPRVD-NEXT: fsub float
// IMPRVD-NEXT: fdiv float
- // PRMTD: load float, ptr {{.*}}
- // PRMTD: fpext float {{.*}} to double
- // PRMTD-NEXT: fpext float {{.*}} to double
andykaylor wrote:
ping for review
https://github.com/llvm/llvm-project/pull/89473
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/89473
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/91017
This change refactors RenderFloatingPointOptions() to eliminate some
excessively complicated logic and a redundant switch statement. The
logic being simplified is an artifact of the original -ffp-model
implemen
@@ -3010,13 +2995,8 @@ static void RenderFloatingPointOptions(const ToolChain
&TC, const Driver &D,
// Validate and pass through -ffp-contract option.
case options::OPT_ffp_contract: {
StringRef Val = A->getValue();
- if (PreciseFPModel) {
a
@@ -3225,11 +3204,10 @@ static void RenderFloatingPointOptions(const ToolChain
&TC, const Driver &D,
if (!FPContract.empty())
CmdArgs.push_back(Args.MakeArgString("-ffp-contract=" + FPContract));
- if (!RoundingFPMath)
-CmdArgs.push_back(Args.MakeArgString("-fno-ro
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/91017
>From 82e51e4cea0cb889842273fcac874bb52d6bd780 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Fri, 3 May 2024 14:14:58 -0700
Subject: [PATCH 1/2] [NFC][Driver] Clean up RenderFloatingPointOptions()
This cha
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/91017
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/91271
This change refactors the fp-contract handling in
RenderFloatingPointOptions in the clang driver code and fixes some
inconsistencies in the way warnings are reported for changes in the
fp-contract behavior.
>
@@ -2893,7 +2915,6 @@ static void RenderFloatingPointOptions(const ToolChain
&TC, const Driver &D,
AssociativeMath = false;
ReciprocalMath = false;
SignedZeros = true;
- FPContract = "on";
andykaylor wrote:
It was unnecessary. Only one
@@ -238,3 +238,17 @@
// RUN: %clang -### -fno-unsafe-math-optimizations -funsafe-math-optimizations
\
// RUN: -ffp-contract=off -c %s 2>&1 | FileCheck --check-prefix=CHECK-FPC-OFF
%s
+// RUN: %clang -### -funsafe-math-optimizations -ffp-contract=off -c %s 2>&1 \
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
@@ -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
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
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
https://github.com/andykaylor 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
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/104854
This fixes a problem which caused clang to assert in the Sema pragma
handling if it encountered "#pragma STDC FP_CONTRACT DEFAULT" when
compiling with the -ffp-contract=fast-honor-pragmas option.
This fixes h
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/104857
This fixes a problem which caused clang to assert in the Sema pragma
handling if it encountered "#pragma STDC FP_CONTRACT DEFAULT" when
compiling with the -ffp-contract=fast-honor-pragmas option.
This fixes h
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/104854
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/100453
>From 59ac754b9a88037e2348f16e5dc7efbd437d65cb Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 19 Aug 2024 13:41:40 -0700
Subject: [PATCH 1/5] Fix bug with -ffp-contract=fast-honor-pragmas
This fixes a
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/100453
>From 9ee59aa30aa3eb4aba986d8cdfb65fbfc7591f0b 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
https://github.com/andykaylor closed
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
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/104857
>From 59ac754b9a88037e2348f16e5dc7efbd437d65cb Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 19 Aug 2024 13:41:40 -0700
Subject: [PATCH 1/2] Fix bug with -ffp-contract=fast-honor-pragmas
This fixes a
andykaylor wrote:
> LGTM. Thanks. I had to double check, but it looks like the LIT test
> `ffp-contract-fast-honor-pragma-option.cpp` has the same behavior with and
> without this patch. Right? Aren't there already tests that check the output
> of the option?
Yes, the `ffp-contract-fast-honor
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/104857
>From 59ac754b9a88037e2348f16e5dc7efbd437d65cb Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 19 Aug 2024 13:41:40 -0700
Subject: [PATCH 1/3] Fix bug with -ffp-contract=fast-honor-pragmas
This fixes a
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/104857
>From 59ac754b9a88037e2348f16e5dc7efbd437d65cb Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Mon, 19 Aug 2024 13:41:40 -0700
Subject: [PATCH 1/3] Fix bug with -ffp-contract=fast-honor-pragmas
This fixes a
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/104857
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/andykaylor created
https://github.com/llvm/llvm-project/pull/105746
Change the handling of -ffp-contract=fast such that the contract
semantics described in the IR are always respected. The front end was
already generating IR that enabled or disabled contraction as requested
by
andykaylor wrote:
> Is the backend actually ready for this? Looking quickly at the backend, it
> looks like target-independent code is fine, but some of the target-specific
> code doesn't respect the "contract" flag on instructions.
Doesn't respect it in what way? Do you mean it doesn't attemp
@@ -3178,6 +3178,13 @@ static void RenderFloatingPointOptions(const ToolChain
&TC, const Driver &D,
StringRef Val = A->getValue();
if (Val == "fast" || Val == "on" || Val == "off" ||
Val == "fast-honor-pragmas") {
+// fast-honor-pragmas is depreca
@@ -68,35 +68,12 @@
// RUN: -O3 -target-cpu gfx906 -o - -x ir %t.ll \
// RUN: | FileCheck -check-prefixes=COMMON,AMD-OPT-FASTSTD %s
-// Explicit -ffp-contract=fast-honor-pragmas
-// In IR, fmul/fadd instructions with contract flag are emitted.
-// In backend
-//nvptx/a
andykaylor wrote:
> Is the backend actually ready for this? Looking quickly at the backend, it
> looks like target-independent code is fine, but some of the target-specific
> code doesn't respect the "contract" flag on instructions.
I didn't realize I wasn't building all targets in my local sa
andykaylor wrote:
> Is the backend actually ready for this? Looking quickly at the backend, it
> looks like target-independent code is fine, but some of the target-specific
> code doesn't respect the "contract" flag on instructions.
As I just mentioned on my RFC, it turns out the state of back
https://github.com/andykaylor closed
https://github.com/llvm/llvm-project/pull/105746
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
andykaylor wrote:
@rjmccall I understand your point, and I think you're raising a good question.
Let's walk through an example that illustrates why we currently want FMF on
phis and selects and see if we can agree on an alternative way to handle it. In
a comment on https://github.com/llvm/llvm
andykaylor wrote:
> Yeah, the conditional operator doesn't do any floating-path math itself. If
> the first operand is a floating-point expression, we should always be
> modeling that with a float-to-boolean conversion, and the flags should go
> there (if they're necessary — I didn't think com
andykaylor wrote:
> Are you suggesting that loads need to have fast-math flags attached to them?
> Because this sounds like a bad representation in IR.
What I'm primarily suggesting is that we should be handling conditional
operators consistently in the presence of pragmas. Whether that can be
@@ -549,6 +562,22 @@ static bool interp__builtin_fpclassify(InterpState &S,
CodePtr OpPC,
return true;
}
+static bool interp__builtin_fma(InterpState &S, CodePtr OpPC,
+const InterpFrame *Frame, const Function *Func,
+
@@ -2994,6 +2994,29 @@ A "convergencectrl" operand bundle is only valid on a
``convergent`` operation.
When present, the operand bundle must contain exactly one value of token type.
See the :doc:`ConvergentOperations` document for details.
+.. _ob_fpe:
+
+Floating-point Envir
https://github.com/andykaylor commented:
I don't think attaching these operand bundles to the existing set of intrinsics
is what we want to do. I'd prefer to deprecate the existing intrinsics and
define some new scheme that uses these bundles on intrinsics that may be used
in other ways.
One
@@ -43,6 +43,15 @@ enum ExceptionBehavior : uint8_t {
}
+inline bool isValidExceptionBehavior(unsigned X) {
andykaylor wrote:
Do you know why the exception behaviors aren't handled in FloatingPointMode.h?
https://github.com/llvm/llvm-project/pull/109798
___
@@ -2994,6 +2994,29 @@ A "convergencectrl" operand bundle is only valid on a
``convergent`` operation.
When present, the operand bundle must contain exactly one value of token type.
See the :doc:`ConvergentOperations` document for details.
+.. _ob_fpe:
+
+Floating-point Envir
@@ -47,6 +47,15 @@ enum class RoundingMode : int8_t {
Invalid = -1///< Denotes invalid value.
};
+inline bool isValidRoundingMode(int X) {
+ return X >= 0 && X <= static_cast(RoundingMode::Dynamic);
andykaylor wrote:
This isn't a sufficient check. For
https://github.com/andykaylor edited
https://github.com/llvm/llvm-project/pull/109798
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -357,6 +357,9 @@ class IRBuilderBase {
void setConstrainedFPCallAttr(CallBase *I) {
I->addFnAttr(Attribute::StrictFP);
+MemoryEffects ME = MemoryEffects::inaccessibleMemOnly();
andykaylor wrote:
I think all of the constrained intrinsics currently
andykaylor wrote:
> With the constrained intrinsics the default is safe because optimizations
> don't recognize the constrained intrinsic and thus don't know how to optimize
> it. If we instead rely on the strictfp attribute then we'll need possibly
> thousands of checks for this attribute, we
@@ -2994,6 +2994,29 @@ A "convergencectrl" operand bundle is only valid on a
``convergent`` operation.
When present, the operand bundle must contain exactly one value of token type.
See the :doc:`ConvergentOperations` document for details.
+.. _ob_fpe:
+
+Floating-point Envir
@@ -357,6 +357,9 @@ class IRBuilderBase {
void setConstrainedFPCallAttr(CallBase *I) {
I->addFnAttr(Attribute::StrictFP);
+MemoryEffects ME = MemoryEffects::inaccessibleMemOnly();
andykaylor wrote:
>From the LangRef "Calls and invokes with operand b
@@ -4210,26 +4210,45 @@ class AbstractConditionalOperator : public Expr {
/// ConditionalOperator - The ?: ternary operator. The GNU "missing
/// middle" extension is a BinaryConditionalOperator.
-class ConditionalOperator : public AbstractConditionalOperator {
+class Conditi
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/125260
>From 4801886dd4c45d32891a7337ad7430a6c5137929 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Tue, 28 Jan 2025 12:28:58 -0800
Subject: [PATCH 01/11] [CIR] Initial implementation of CIR-to-LLVM IR lowering
https://github.com/andykaylor updated
https://github.com/llvm/llvm-project/pull/125260
>From 4801886dd4c45d32891a7337ad7430a6c5137929 Mon Sep 17 00:00:00 2001
From: Andy Kaylor
Date: Tue, 28 Jan 2025 12:28:58 -0800
Subject: [PATCH 01/11] [CIR] Initial implementation of CIR-to-LLVM IR lowering
101 - 200 of 635 matches
Mail list logo