[PATCH] D92596: [FPEnv] Correct constrained metadata in fp16-ops-strict.c

2020-12-07 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2992 // floating point environment in the loop. +//XXX true? llvm::BasicBlock *startBB = Builder.GetInsertBlock(); mibintc wrote: > did you mean to leave this here? (blame shows t

[PATCH] D92596: [FPEnv] Correct constrained metadata in fp16-ops-strict.c

2020-12-07 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3006 + CodeGenFunction::CGFPOptionsRAII FPOptsRAII(CGF, OpInfo.FPFeatures); SourceLocation Loc = E->getExprLoc(); mibintc wrote: > kpn wrote: > > mibintc wrote: > > > What's the rule

[PATCH] D88913: [FPEnv] Use strictfp metadata in casting nodes

2020-10-23 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:154-155 + OldRounding = CGF.Builder.getDefaultConstrainedRounding(); if (OldFPFeatures == FPFeatures) return; sepavloff wrote: > This check can be lifted to just after the def

[PATCH] D88913: [FPEnv] Use strictfp metadata in casting nodes

2020-10-23 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/test/CodeGen/aarch64-v8.2a-neon-intrinsics-constrained.c:26 +// metadata from the AST instead of the global default from the command line. +// FIXME: All cases of "fpexcept.maytrap" in this test are wrong. + kpn wrote:

[PATCH] D88987: [FPEnv][Clang][Driver] Use MarshallingInfoFlag for -fexperimental-strict-floating-point

2020-10-26 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88987/new/ https://reviews.llvm.org/D88987 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[PATCH] D88913: [FPEnv] Use strictfp metadata in casting nodes

2020-10-27 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D88913#2353379 , @sepavloff wrote: > Generally the patch looks good. But the need to expect incorrect values in > tests is a concern. Maybe this is a consequence of storing exception behavior > in a separate field of CGFPOptionsRA

[PATCH] D90316: [FPEnv] Diagnose pragmas FENV_ROUND,_ACCESS and float_control if target does not support StrictFP

2020-10-28 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. I also added "-fexperimental-strict-floating-point" which makes it possible to write tests for a target when bringing up the support on that target. I think it would be confusing for that flag to work on command line arguments but not pragmas. Repository: rG LLVM Github

[PATCH] D88913: [FPEnv] Use strictfp metadata in casting nodes

2020-10-30 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. I'll see how much I can simplify of the tests. Comment at: clang/test/CodeGen/exprs-strictfp.c:1 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -ffp-exception-beha

[PATCH] D99675: RFC [llvm][clang] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

2021-05-18 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D99675#2696327 , @pengfei wrote: > In D99675#2695424 , @kpn wrote: > >> What changes are needed for a backend, and what happens if they aren't done? > > As far as I understand it, backend doe

[PATCH] D94614: [FPEnv][X86] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins

2021-01-22 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn updated this revision to Diff 318567. kpn added a comment. Update for review comments: Move uses of CGFPOptionsRAII lower and closer to where they are needed. This should be less error prone as well. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94614/new/ https://reviews.llvm.org/

[PATCH] D94614: [FPEnv][X86] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins

2021-02-03 Thread Kevin P. Neal via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG81b69879c946: [FPEnv][X86] Platform builtins edition: clang should get from the AST the… (authored by kpn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D946

[PATCH] D95948: Stop traping on sNaN in __builtin_isnan

2021-02-04 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. This looks like a definite step forward. Thank you! Can you do an AArch64 test case showing long double? Right now there's no 128-bit test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95948/new/ https://reviews.llvm.or

[PATCH] D95948: Stop traping on sNaN in __builtin_isnan

2021-02-04 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D95948#2542884 , @mibintc wrote: > Should we add tests for mlong-double-64, -80, -128? Assuming Ty->getScalarSizeInBits() returns 64, 80, or 128 in those cases, I think it's good enough to just add an AArch64 (or some other 128-bi

[PATCH] D95948: Stop traping on sNaN in __builtin_isnan

2021-02-05 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn accepted this revision. kpn added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95948/new/ https://reviews.llvm.org/D95948 ___ cfe-com

[PATCH] D97125: Stop traping on sNaN in __builtin_isinf

2021-02-22 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. System/Z's TEST DATA CLASS instruction covers most (all?) of the possible FP value states. You might want to subscribe, or add as a reviewer, jonpa just to make sure everyone stays in sync. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D139629: clang: Stop emitting "strictfp"

2022-12-19 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2135 -llvm::AttrBuilder FuncAttrs(F->getContext()); -FuncAttrs.addAttribute("strictfp"); -F->addFnAttrs(FuncAttrs); arsenm wrote: > andrew.w.kaylor wrote: > > arsenm wrote: > >

[PATCH] D139629: clang: Stop emitting "strictfp"

2022-12-19 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2135 -llvm::AttrBuilder FuncAttrs(F->getContext()); -FuncAttrs.addAttribute("strictfp"); -F->addFnAttrs(FuncAttrs); arsenm wrote: > kpn wrote: > > arsenm wrote: > > > andrew.w.

[PATCH] D142907: LangRef: Add "dynamic" option to "denormal-fp-math"

2023-02-01 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. We use "dynamic" for the constrained intrinsics. I'd stay consistent with our terminology and stick with "dynamic" here. I like the amount of testing. You may have gotten every single combination of cases, but I didn't go far enough to check. Comment at:

[PATCH] D142907: LangRef: Add "dynamic" option to "denormal-fp-math"

2023-02-01 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: llvm/test/Transforms/Inline/AMDGPU/inline-denormal-fp-math.ll:78 +; CHECK-NEXT:[[CALL:%.*]] = call i32 @func_default() +; CHECK-NEXT:ret i32 [[CALL]] ; arsenm wrote: > kpn wrote: > > Are we changing the behavior in

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-17 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. Are we testing _Complex multiply or subtraction anywhere? I have a vague memory of multiply not working correctly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141765/new/ https://reviews.llvm.org/D141765 ___

[PATCH] D141765: [FPEnv] Fix complex operations in strictfp mode

2023-01-17 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/test/CodeGen/complex-strictfp.c:8-9 // Include rounding metadata in the testing. -// FIXME: All cases of "fpexcept.maytrap" in this test are wrong. -// FIXME: All cases of "round.tonearest" in this test are wrong. +// All cases of "fp

[PATCH] D126364: Fix interaction of pragma FENV_ACCESS with other pragmas

2022-06-01 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. >> On targets that support static rounding mode (like RISCV) dynamic and >> constant rounding modes may be different and the behavior changes if default >> mode is replaced by dynamic. > > Whether a target supports static rounding modes on floating-point > instructions is c

[PATCH] D154991: [FPEnv][TableGen] Add strictfp attribute to constrained intrinsics by default.

2023-07-11 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn created this revision. kpn added reviewers: pengfei, chapuni, akshaykhadse, craig.topper, arsenm. Herald added a subscriber: jdoerfert. Herald added a project: All. kpn requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, wdng. Herald added projects: clang, LL

[PATCH] D154991: [FPEnv][TableGen] Add strictfp attribute to constrained intrinsics by default.

2023-07-11 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn updated this revision to Diff 539204. kpn added a comment. Move test and change to round-tripping as requested. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154991/new/ https://reviews.llvm.org/D154991 Files: clang/test/CodeGenOpenCL/cl20-device-side-enqueue-attributes.cl llvm

[PATCH] D154991: [FPEnv][TableGen] Add strictfp attribute to constrained intrinsics by default.

2023-07-12 Thread Kevin P. Neal via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG91f886a40d3f: [FPEnv][TableGen] Add strictfp attribute to constrained intrinsics by default. (authored by kpn). Repository: rG LLVM Github Monorep

[PATCH] D77074: [FPEnv][AArch64] Platform-specific builtin constrained FP enablement

2020-03-30 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn marked 3 inline comments as done. kpn added a comment. Note that the AArch64 backend isn't ready for some of these changes. That's why the test is marked XFAIL. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:5706 +Function *F; +//exit(2); // XXX +if (Builder.getIs

[PATCH] D77074: [FPEnv][AArch64] Platform-specific builtin constrained FP enablement

2020-04-02 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn marked an inline comment as done. kpn added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:8486-8492 + return Builder.CreateConstrainedFPCall( + F, + {EmitScalarExpr(E->getArg(1)), EmitScalarExpr(E->getArg(2)), Ops[0]}); +} else { +

[PATCH] D70256: [FPEnv] clang support for constrained FP builtins

2019-11-14 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn created this revision. kpn added reviewers: rjmccall, dblaikie. Herald added projects: clang, LLVM. Herald added a subscriber: llvm-commits. Currently if constrained fp math is requested clang is still emitting calls to the non-constrained versions of math builtins. This patch corrects that f

[PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-11-18 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. Does anyone think a warning is appropriate because the new flags are exercising experimental, incomplete code in both clang and llvm? The warning would be removed when we believe the feature is complete and ready to use. Comment at: llvm/include/llvm/IR/I

[PATCH] D70256: [FPEnv] clang support for constrained FP builtins

2019-11-18 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. D62731 is required for testing this patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70256/new/ https://reviews.llvm.org/D70256 ___ cfe-commit

[PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-11-18 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D62731#1750427 , @mibintc wrote: > In D62731#1750412 , @kpn wrote: > > > Does anyone think a warning is appropriate because the new flags are > > exercising experimental, incomplete code in

[PATCH] D70256: [FPEnv] clang support for constrained FP builtins

2019-11-18 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn marked 2 inline comments as done. kpn added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:357 + + if (ConstrainedIntrinsicID != Intrinsic::not_intrinsic && + CGF.Builder.getIsFPConstrained()) { rjmccall wrote: > I don't see any situation

[PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-11-19 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: llvm/include/llvm/IR/IRBuilder.h:262 Function *F = BB->getParent(); -if (!F->hasFnAttribute(Attribute::StrictFP)) { +if (F && !F->hasFnAttribute(Attribute::StrictFP)) { F->addFnAttr(Attribute::StrictFP);

[PATCH] D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior

2019-12-02 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: llvm/include/llvm/IR/IRBuilder.h:268 I->addAttribute(AttributeList::FunctionIndex, Attribute::StrictFP); -setConstrainedFPFunctionAttr(); } mibintc wrote: > @kpn I got rid of this line because the function attr

[PATCH] D70256: [FPEnv] clang support for constrained FP builtins

2019-12-10 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn updated this revision to Diff 233073. kpn added a comment. Update for review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70256/new/ https://reviews.llvm.org/D70256 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/test/CodeGen/constrained-math-builtins.c llvm/include/l

[PATCH] D70256: [FPEnv] clang support for constrained FP builtins

2019-12-10 Thread Kevin P. Neal via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6515c524b0ae: [FPEnv] clang support for constrained FP builtins (authored by kpn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70256/new/ https://reviews.

[PATCH] D71723: ConstrainedFP: use API compatible with opaque pointers.

2019-12-19 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn accepted this revision. kpn added a comment. This revision is now accepted and ready to land. LGTM. Thanks for the fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71723/new/ https://reviews.llvm.org/D71723

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-20 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D69272#1792856 , @mibintc wrote: > In D69272#1717021 , @kpn wrote: > > > Is there a way forward to support having the #pragma at the start of any > > block inside a function? The effect won'

[PATCH] D69272: Restricted variant of '#pragma STDC FENV_ACCESS'

2019-12-23 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D69272#1794630 , @sepavloff wrote: > Putting restriction on use of the pragma is of course, a temporary solution, > it is not usable in all cases. But for some cases it is usable in production > code. Where small pieces of code ma

[PATCH] D71854: [SystemZ] Use FNeg in s390x clang builtins

2019-12-24 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn created this revision. kpn added reviewers: cfe-commits, uweigand. Herald added a project: clang. The s390x builtins are still using FSub instead of FNeg. Correct that. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D71854 Files: clang/lib/CodeGen/CGBuiltin.cpp Index: c

[PATCH] D73570: [FPEnv][X86] Platform-specific builtin constrained FP enablement

2020-01-31 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn updated this revision to Diff 241771. kpn added a comment. Address review comments: FMA tests are now run optimized. This changes where the FIXME lines are located. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73570/new/ https://reviews.llvm.

[PATCH] D73570: [FPEnv][X86] Platform-specific builtin constrained FP enablement

2020-02-06 Thread Kevin P. Neal via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG208470dd5d0a: [FPEnv][X86] Platform-specific builtin constrained FP enablement (authored by kpn). Repository: rG LLVM G

[PATCH] D72722: [FPEnv] [SystemZ] Platform-specific builtin constrained FP enablement

2020-01-21 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn marked an inline comment as done. kpn added inline comments. Comment at: clang/test/CodeGen/builtins-systemz-vector2-constrained.c:25 + // CHECK: [[NEG:%[^ ]+]] = fneg <2 x double> {{.*}} + // CHECK: [[RES:%[^ ]+]] = call <2 x double> @llvm.experimental.constrained.fma.v2

[PATCH] D72722: [FPEnv] [SystemZ] Platform-specific builtin constrained FP enablement

2020-01-21 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn updated this revision to Diff 239324. kpn added a comment. Update for review comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72722/new/ https://reviews.llvm.org/D72722 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/test/CodeGen/builtins-systemz-vector-constrained.c clan

[PATCH] D72722: [FPEnv] [SystemZ] Platform-specific builtin constrained FP enablement

2020-01-21 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn updated this revision to Diff 239325. kpn added a comment. Eliminate a blank line I thought I had already had gotten. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72722/new/ https://reviews.llvm.org/D72722 Files: clang/lib/CodeGen/CGBuiltin.cpp clang/test/CodeGen/builtins-syst

[PATCH] D72722: [FPEnv] [SystemZ] Platform-specific builtin constrained FP enablement

2020-01-21 Thread Kevin P. Neal via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2e667d07c773: [FPEnv][SystemZ] Platform-specific builtin constrained FP enablement (authored by kpn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72722/new

[PATCH] D72820: [FPEnv] Add pragma FP_CONTRACT support under strict FP.

2020-01-24 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3381 + "constrained mode"); +FMulAdd = Builder.CreateCall( +CGF.CGM.getIntrinsic(llvm::Intrinsic::experimental_constrained_fmuladd, craig.topper wrote: > Doesn't this

[PATCH] D72820: [FPEnv] Add pragma FP_CONTRACT support under strict FP.

2020-01-24 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3381 + "constrained mode"); +FMulAdd = Builder.CreateCall( +CGF.CGM.getIntrinsic(llvm::Intrinsic::experimental_constrained_fmuladd, craig.topper wrote: > kpn wrote: >

[PATCH] D73570: [FPEnv][X86] Platform-specific builtin constrained FP enablement

2020-01-28 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn created this revision. kpn added reviewers: craig.topper, andrew.w.kaylor. Herald added a project: clang. Herald added a subscriber: cfe-commits. [FPEnv][X86] Platform-specific builtin constrained FP enablement When constrained floating point is enabled the X86-specific builtins don't use co

[PATCH] D73570: [FPEnv][X86] Platform-specific builtin constrained FP enablement

2020-01-29 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn marked 2 inline comments as done. kpn added inline comments. Comment at: clang/test/CodeGen/fma-builtins-constrained.c:4 +// RUN: %clang_cc1 -ffreestanding %s -triple=x86_64-apple-darwin -target-feature +fma -S -o - | FileCheck --check-prefix=COMMON --check-prefix=CHECK-ASM

[PATCH] D142907: LangRef: Add "dynamic" option to "denormal-fp-math"

2023-02-16 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. What's the plan for tying this to strictfp? Because I don't it should be tied to cases where we use the constrained intrinsics but the exceptions are ignored and the default rounding is in stated. Those instructions are supposed to behave the same as the non-constrained ins

[PATCH] D144447: [Clang] Teach buildFMulAdd to peek through fneg to find fmul.

2023-02-21 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3738 - assert(!(negMul && negAdd) && "Only one of negMul and negAdd should be set."); - Value *MulOp0 = MulOp->getOperand(0); If I'm reading this right it looks like the assert() wasn'

[PATCH] D144447: [Clang] Teach buildFMulAdd to peek through fneg to find fmul.

2023-02-23 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn accepted this revision. kpn added a comment. This revision is now accepted and ready to land. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D17/new/ https://reviews.llvm.org/D17 ___ cfe-

[PATCH] D139629: clang: Stop emitting "strictfp"

2022-12-08 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. It looks like clang does have at least one test that checks for the strictfp attribute on function definitions. We also have a number that test for the strictfp attribute on function calls. So I think our test coverage is in good shape. LGTM. CHANGES SINCE LAST ACTION

[PATCH] D112932: Use llvm.is_fpclass to implement FP classification functions

2022-12-13 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/test/CodeGen/strictfp_builtins.c:160 +// CHECK-NEXT:[[TMP1:%.*]] = call double @llvm.fabs.f64(double [[TMP0]]) #[[ATTR5]] +// CHECK-NEXT:[[ISINF:%.*]] = call i1 @llvm.experimental.constrained.fcmp.f64(double [[TMP1]], double

[PATCH] D115804: [CodeGen] use saturating FP casts when compiling with "no-strict-float-cast-overflow"

2021-12-21 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D115804#3202479 , @sepavloff wrote: > In D115804#3201681 , @spatel wrote: > >> In D115804#3201044 , @craig.topper >> wrote: >> >>> What's the plan

[PATCH] D98923: [Driver] Pass -fexperimental-strict-floating-point to cc1 if it is specified

2021-03-19 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. Test case? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98923/new/ https://reviews.llvm.org/D98923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D100118: [clang] RFC Support new builtin __arithmetic_fence to control floating point optimization, and new clang option fprotect-parens

2021-04-16 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. I thought that adding a new fence required changing every optimization pass in LLVM. That's why the constrained intrinsics were implemented they way they are where no fence is needed. Aren't you going to have miscompiles using this new fence until all that optimization wor

[PATCH] D100118: [clang] RFC Support new builtin __arithmetic_fence to control floating point optimization, and new clang option fprotect-parens

2021-04-16 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D100118#2695365 , @kpn wrote: > I thought that adding a new fence required changing every optimization pass > in LLVM. That's why the constrained intrinsics were implemented they way they > are where no fence is needed. > > Aren'

[PATCH] D99675: RFC [llvm][clang] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

2021-04-16 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. What changes are needed for a backend, and what happens if they aren't done? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99675/new/ https://reviews.llvm.org/D99675 ___ cfe-commits

[PATCH] D99675: RFC [llvm][clang] Create new intrinsic llvm.arith.fence to control FP optimization at expression level

2021-04-16 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D99675#2695480 , @mibintc wrote: > In D99675#2695424 , @kpn wrote: > >> What changes are needed for a backend, and what happens if they aren't done? > > In the clang patch, I'm planning to ad

[PATCH] D100118: [clang] RFC Support new builtin __arithmetic_fence to control floating point optimization, and new clang option fprotect-parens

2021-04-20 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2844 + return RValue::get( + Builder.CreateArithmeticFence(ArgValue, ConvertType(ArgType))); +return RValue::get(ArgValue); Does this say that the fence will be silently drop

[PATCH] D100834: Bug 49739 - [Matrix] Support #pragma clang fp

2021-04-20 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. I don't know the matrix implementation so I can't swear this hits every place needed, but the uses of CGFPOptionsRAII in this patch look correct at least. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100834/new/ https://revie

[PATCH] D94186: [FPEnv][PowerPC] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins

2021-01-06 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn created this revision. kpn added reviewers: steven.zhang, nemanjai. kpn added a project: clang. Herald added subscribers: shchenz, kbarton. kpn requested review of this revision. Herald added a subscriber: cfe-commits. Currently clang is not correctly retrieving from the AST the metadata for

[PATCH] D94614: [FPEnv][X86] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins

2021-01-13 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn created this revision. kpn added reviewers: craig.topper, andrew.w.kaylor. kpn added a project: clang. Herald added a subscriber: pengfei. kpn requested review of this revision. Herald added a subscriber: cfe-commits. Currently clang is not correctly retrieving from the AST the metadata for c

[PATCH] D94614: [FPEnv][X86] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins

2021-01-14 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. This doesn't add metadata to llvm intrinsics that are not constrained. The metadata is added by the IRBuilder when the IRBuilder is used to add constrained intrinsics. When adding non-constrained intrinsics that have a direct mapping to constrained intrinsics, and constrain

[PATCH] D94614: [FPEnv][X86] Platform builtins edition: clang should get from the AST the metadata for constrained FP builtins

2021-01-19 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:12268 + case X86::BI__builtin_ia32_cvtqq2pd512_mask: { +CodeGenFunction::CGFPOptionsRAII FPOptsRAII(*this, E); return EmitX86ConvertIntToFp(*this, Ops, /*IsSigned*/true); pengfei wro

[PATCH] D104854: Introduce intrinsic llvm.isnan

2021-08-20 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D104854#2957490 , @lebedev.ri wrote: > In D104854#2957471 , @sepavloff > wrote: > >> In D104854#2957423 , @spatel wrote: >> >>> Is it intentional

[PATCH] D104854: Introduce intrinsic llvm.isnan

2021-08-23 Thread Kevin P. Neal via Phabricator via cfe-commits
kpn added a comment. In D104854#2959680 , @thopre wrote: > In D104854#2957735 , @kpn wrote: > >> In D104854#2957490 , @lebedev.ri >> wrote: >> >>> In D104854#2957471

<    1   2