Page MenuHomePhabricator

kpn (Kevin P. Neal)
User

Projects

User does not belong to any projects.

User Details

User Since
Feb 20 2018, 9:31 AM (99 w, 3 d)

Recent Activity

Yesterday

kpn added inline comments to D72930: [FEnv] Constfold some unary constrained operations.
Fri, Jan 17, 10:32 AM · Restricted Project
kpn committed rG0bcfafc5e71d: [SeparateConstOffsetFromGEP] Fix: sext(a) + sext(b) -> sext(a + b) matches add… (authored by ajwock).
[SeparateConstOffsetFromGEP] Fix: sext(a) + sext(b) -> sext(a + b) matches add…
Fri, Jan 17, 9:25 AM
kpn closed D65967: [SeparateConstOffsetFromGEP][PowerPC] Fix: sext(a) + sext(b) -> sext(a + b) matches add and sub instructions with one another.
Fri, Jan 17, 9:25 AM · Restricted Project

Wed, Jan 15

kpn added a comment to D65967: [SeparateConstOffsetFromGEP][PowerPC] Fix: sext(a) + sext(b) -> sext(a + b) matches add and sub instructions with one another.

Excellent! Thanks Matt!

Wed, Jan 15, 7:35 AM · Restricted Project

Tue, Jan 14

kpn created D72722: [FPEnv] [SystemZ] Platform-specific builtin constrained FP enablement.
Tue, Jan 14, 10:32 AM · Restricted Project

Tue, Jan 7

kpn added a comment to D72224: [LegalizeVectorOps] Improve handling of multi-result operations..

Looks like the test case didn't make it over.

Tue, Jan 7, 6:55 AM · Restricted Project

Mon, Jan 6

kpn added a comment to D72224: [LegalizeVectorOps] Improve handling of multi-result operations..

I'm happy to see the uses of ReplaceAllUsesOfValueWith() gone. Having nodes be only halfway spliced into the tree for a while seemed like it could cause bugs later. I imagine the scalar legalizer might could benefit from similar changes at some point in the future.

Mon, Jan 6, 10:44 AM · Restricted Project

Thu, Jan 2

kpn committed rG89d6c288ba5a: [SystemZ] Use FNeg in s390x clang builtins (authored by kpn).
[SystemZ] Use FNeg in s390x clang builtins
Thu, Jan 2, 9:21 AM
kpn closed D71854: [SystemZ] Use FNeg in s390x clang builtins.

My pleasure!

Thu, Jan 2, 9:19 AM · Restricted Project
kpn updated the diff for D71854: [SystemZ] Use FNeg in s390x clang builtins.

Update now-failing tests.

Thu, Jan 2, 8:04 AM · Restricted Project

Tue, Dec 24

kpn committed rG0293b5d67123: [NFC] Remove some dead code from CGBuiltin.cpp. (authored by kpn).
[NFC] Remove some dead code from CGBuiltin.cpp.
Tue, Dec 24, 6:41 AM
kpn created D71854: [SystemZ] Use FNeg in s390x clang builtins.
Tue, Dec 24, 6:14 AM · Restricted Project

Mon, Dec 23

kpn added a comment to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.

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 may be extracted into separate functions, this solution can provide tolerable performance loss, if most part of the program doesn't use constrained intrinsics. Warning prevents users from false expectations. Use in production code ensures further development of the feature.

Full-fledged solution requires full support of constrained intrinsics in optimizations. It is not clear how large this work is, but odd are that it would require substantial efforts. It this case usable implementation of 'pragma STDC FE_ACCESS' would postponed. The restricted solution can be implemented much faster and it does not impede development of the full-fledged one.

Mon, Dec 23, 10:13 AM · Restricted Project
kpn added a comment to D69798: Implement inlining of strictfp functions.

Imagine a case where some function "X()" under the #pragma and a non-default FP environment calls a function "Y()" in a different TU and not under the #pragma. Then the programmer moves "Y()" into a header file. Under your proposal Y() would get different FP environments at run time simply because it was moved from a different TU into a header file. Surprise!

Mon, Dec 23, 9:43 AM · Restricted Project
kpn added a comment to D69798: Implement inlining of strictfp functions.
In D69798#1793237, @kpn wrote:
Mon, Dec 23, 6:21 AM · Restricted Project
kpn added a comment to D71742: Added intrinsics for access to FP environment.
In D71742#1793243, @kpn wrote:

I don't see the need. Changing the FP environment in a mixed environment program is the responsibility of the programmer, and standard calls already exist for this.

This is about inlining. In the code like this:

double f1(double x, double y) {
  return x + y;
}
double f2(double x, double y) {
  #pragma STDC FENV_ACCESS ON
  ...
  return f1(x, y);
}

compiler might inline call to f1 in f2. However the inlined function f1 expects default FP environment but is called in some other one.

Mon, Dec 23, 6:12 AM · Restricted Project

Fri, Dec 20

kpn added a comment to D71742: Added intrinsics for access to FP environment.

I don't see the need. Changing the FP environment in a mixed environment program is the responsibility of the programmer, and standard calls already exist for this.

Fri, Dec 20, 12:11 PM · Restricted Project
kpn added a comment to D69798: Implement inlining of strictfp functions.

When function that uses default FP environment is inlined into strictfp function, code of the former will be executed in the FP environment set in the strictfp function. To fix this behavior the FP environment should be saved upon entry to the inlined function, FP environment reset to default state, and the saved state must be restored upon leaving the inlined function.

So if the function is inlined it would use the reset state, but if it doesn't get inlined it would use the caller's state. Doesn't that mean whether or not the compiler inlines the function changes the behavior of the program?

It is so now. If a code in which #pargma STDC FENV_ACCESS ON acts calls an external function, it would be executed in caller's FP environment. This is wrong if the callee expects default one. We could put get_fenv, reset_fenv and set_fenv, introduced in D71742, around all calls, unless the called function has strictfp attribute, or we know that it does not use FP operation. It however could create unneeded code, which is bad for performance. We need to elaborate proper solution.

Fri, Dec 20, 12:11 PM · Restricted Project
kpn added a comment to D69272: Enable '#pragma STDC FENV_ACCESS' in frontend.
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't be restricted to that block, true, but the standard does say the #pragma is allowed.

Please clarify: I understand that the backend wants all floating point operations to be built using Floating Point Constrained Intrinsics if any operations use constrained intrinsic. But I thought that, if the constraint were only to apply to a block within the function, that the operations outside the block would be written with the default setting for rounding mode and exception behavior, and the operations inside the constrained block would be created with different settings. Like this

Fri, Dec 20, 8:09 AM · Restricted Project

Thu, Dec 19

kpn accepted D71723: ConstrainedFP: use API compatible with opaque pointers..

LGTM. Thanks for the fix!

Thu, Dec 19, 12:43 PM · Restricted Project, Restricted Project

Dec 18 2019

kpn added inline comments to D71624: [FPEnv] Strict versions of llvm.minimum/llvm.maximum.
Dec 18 2019, 9:26 AM · Restricted Project

Dec 17 2019

kpn committed rG2f40f5681d0d: [FPEnv] IRBuilder support for constrained sitofp/uitofp. (authored by kpn).
[FPEnv] IRBuilder support for constrained sitofp/uitofp.
Dec 17 2019, 9:35 AM
kpn committed rGb1d8576b0a9f: This adds constrained intrinsics for the signed and unsigned conversions of… (authored by kpn).
This adds constrained intrinsics for the signed and unsigned conversions of…
Dec 17 2019, 7:09 AM
kpn closed D69275: Add constrained int->FP intrinsics.
Dec 17 2019, 7:09 AM · Restricted Project

Dec 16 2019

kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Address review comments.

Dec 16 2019, 12:53 PM · Restricted Project
kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Dec 16 2019, 10:53 AM · Restricted Project
kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Address review comments. I've eliminated the need to call SelectionDAG::UnrollVectorOp() and therefore eliminated the changes to that function.

Dec 16 2019, 10:43 AM · Restricted Project

Dec 13 2019

kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Dec 13 2019, 11:28 AM · Restricted Project

Dec 12 2019

kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Dec 12 2019, 5:56 AM · Restricted Project

Dec 11 2019

kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Address review comments, with changes to LegalizeDAG.cpp and LegalizeVectorOps.cpp.

Dec 11 2019, 1:05 PM · Restricted Project
kpn added a comment to D69275: Add constrained int->FP intrinsics.

Huh. I forgot to submit my comments earlier.

Dec 11 2019, 1:05 PM · Restricted Project

Dec 10 2019

kpn updated the diff for D68233: [FPEnv] [WIP] Verify strictfp attribute correctness.

Rebase. Add missing tests.

Dec 10 2019, 10:55 AM · Restricted Project
kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Eliminate write-only variable.

Dec 10 2019, 10:46 AM · Restricted Project
kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Dec 10 2019, 10:46 AM · Restricted Project
kpn added a child revision for D70096: [strictfp] Replace dangling strictfp attrs with nobuiltin: D68233: [FPEnv] [WIP] Verify strictfp attribute correctness.
Dec 10 2019, 10:46 AM · Restricted Project
kpn added a parent revision for D68233: [FPEnv] [WIP] Verify strictfp attribute correctness: D70096: [strictfp] Replace dangling strictfp attrs with nobuiltin.
Dec 10 2019, 10:46 AM · Restricted Project
kpn committed rG6515c524b0ae: [FPEnv] clang support for constrained FP builtins (authored by kpn).
[FPEnv] clang support for constrained FP builtins
Dec 10 2019, 10:09 AM
kpn closed D70256: [FPEnv] clang support for constrained FP builtins.
Dec 10 2019, 10:09 AM · Restricted Project, Restricted Project
kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Update for review comments.

Dec 10 2019, 6:11 AM · Restricted Project
kpn updated the diff for D70256: [FPEnv] clang support for constrained FP builtins.

Update for review comments.

Dec 10 2019, 6:11 AM · Restricted Project, Restricted Project
kpn commandeered D69275: Add constrained int->FP intrinsics.

Prep to update patch.

Dec 10 2019, 6:04 AM · Restricted Project

Dec 9 2019

kpn added a comment to D71218: [FPEnv] Remove unnecessary rounding mode argument for constrained intrinsics.

I think this is a good idea.

Dec 9 2019, 11:20 AM · Restricted Project, Restricted Project
kpn abandoned D70451: [FPEnv] IRBuilder should not put strictfp on function definitions automatically.

Redundant now.

Dec 9 2019, 7:19 AM · Restricted Project
kpn added a comment to D70451: [FPEnv] IRBuilder should not put strictfp on function definitions automatically.

@mibintc: This ticket is redundant now, correct? This was solved in the re-push of the command line option changes?

Dec 9 2019, 7:01 AM · Restricted Project
kpn added a comment to D69275: Add constrained int->FP intrinsics.

The calls DAG.UnrollVectorOp() can't be used in place of DAGTypeLegalizer::ReplaceValueWith() because then the replaced node doesn't get properly deleted. This then results in an assertion failure later because the replaced node wasn't legal. And having SelectionDAG call into DAGTypeLegalizer doesn't seem like a winning idea, at least not without some plumbing. So today I'm going to punt on merging those functions together and just post what I've got. After breakfast sometime.

Dec 9 2019, 5:00 AM · Restricted Project

Dec 6 2019

kpn added a comment to D69275: Add constrained int->FP intrinsics.

I'm still working on this ticket daily! I'm trying to merge the two vector unrolling functions like Ulrich suggested. But I ran into problems that lead me to think we may have a serious issue lurking that we'll need to fix. That's what I've been working on: trying to understand the issue and see if it needs further investigation.

Dec 6 2019, 5:07 AM · Restricted Project

Dec 2 2019

kpn added inline comments to D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior.
Dec 2 2019, 12:53 PM · Restricted Project, Restricted Project
kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Dec 2 2019, 6:37 AM · Restricted Project

Nov 27 2019

kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Nov 27 2019, 12:10 PM · Restricted Project
kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Update for review comments. Use MERGE_VALUES node. Eliminate hacks to avoid x86 custom lowering. This means more x86 target support.

Nov 27 2019, 11:13 AM · Restricted Project

Nov 19 2019

kpn added inline comments to D70451: [FPEnv] IRBuilder should not put strictfp on function definitions automatically.
Nov 19 2019, 12:34 PM · Restricted Project
kpn added a comment to D70451: [FPEnv] IRBuilder should not put strictfp on function definitions automatically.

It works for me too. I need to send an update for my new test case fpconstrained.cpp

Nov 19 2019, 11:56 AM · Restricted Project
kpn added a comment to D70451: [FPEnv] IRBuilder should not put strictfp on function definitions automatically.

This seems like a much more reasonable approach in general. Frontend authors who intend to use constrained FP need to be making broader changes to how they emit IR in order to satisfy the requirements of the intrinsics.

Have we been able to extract a test case which causes the insertion into an unparented basic block? If that's happening in Clang IRGen, I consider that a bug. I can't speak for LLVM passes, though; they do silly things for obscure reasons.

Nov 19 2019, 10:34 AM · Restricted Project
kpn created D70451: [FPEnv] IRBuilder should not put strictfp on function definitions automatically.
Nov 19 2019, 10:06 AM · Restricted Project
kpn added inline comments to D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior.
Nov 19 2019, 6:13 AM · Restricted Project, Restricted Project

Nov 18 2019

kpn added inline comments to D70256: [FPEnv] clang support for constrained FP builtins.
Nov 18 2019, 1:15 PM · Restricted Project, Restricted Project
kpn added a comment to D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior.
In D62731#1750412, @kpn wrote:

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.

@kpn Can you say more about "incomplete code in ... clang". I don't know what's missing from clang.

Nov 18 2019, 1:15 PM · Restricted Project, Restricted Project
kpn added a comment to D70256: [FPEnv] clang support for constrained FP builtins.

D62731 is required for testing this patch.

Nov 18 2019, 12:30 PM · Restricted Project, Restricted Project
kpn added a parent revision for D70256: [FPEnv] clang support for constrained FP builtins: D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior.
Nov 18 2019, 12:30 PM · Restricted Project, Restricted Project
kpn added a child revision for D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior: D70256: [FPEnv] clang support for constrained FP builtins.
Nov 18 2019, 12:30 PM · Restricted Project, Restricted Project
kpn added a comment to D62731: Add support for options -frounding-math, -ftrapping-math, -ffp-model=, and -ffp-exception-behavior=, : Specify floating point behavior.

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.

Nov 18 2019, 12:21 PM · Restricted Project, Restricted Project

Nov 14 2019

kpn committed rGd2b6cc7ff6d8: Document more specifically the rounding for "llvm.round". (authored by kpn).
Document more specifically the rounding for "llvm.round".
Nov 14 2019, 10:25 AM
kpn closed D68810: Document rounding for llvm.lround and llvm.lrint.
Nov 14 2019, 10:25 AM · Restricted Project
kpn created D70256: [FPEnv] clang support for constrained FP builtins.
Nov 14 2019, 10:24 AM · Restricted Project, Restricted Project
kpn committed rG56ae3e2692ed: Make the language more consistent since I'm about to commit a content change… (authored by kpn).
Make the language more consistent since I'm about to commit a content change…
Nov 14 2019, 10:15 AM
kpn added a comment to D70096: [strictfp] Replace dangling strictfp attrs with nobuiltin.
In D70096#1744035, @kpn wrote:

Does strictfp need to be on function declarations? Currently it isn't.

Nov 14 2019, 8:07 AM · Restricted Project

Nov 13 2019

kpn added inline comments to D68810: Document rounding for llvm.lround and llvm.lrint.
Nov 13 2019, 1:00 PM · Restricted Project
kpn added inline comments to D68810: Document rounding for llvm.lround and llvm.lrint.
Nov 13 2019, 12:40 PM · Restricted Project
kpn updated the diff for D68810: Document rounding for llvm.lround and llvm.lrint.

Drop the verbiage about exceptions. Update ticket description and title.

Nov 13 2019, 11:29 AM · Restricted Project
kpn added a comment to D70096: [strictfp] Replace dangling strictfp attrs with nobuiltin.

Does strictfp need to be on function declarations? Currently it isn't.

Nov 13 2019, 7:59 AM · Restricted Project

Nov 12 2019

kpn added a comment to D70096: [strictfp] Replace dangling strictfp attrs with nobuiltin.
In D70096#1741213, @kpn wrote:

Do we want to restrict this so it doesn't get upgraded if found in a future bitcode version?

How would we do that?

Nov 12 2019, 12:10 PM · Restricted Project
kpn added a comment to D69275: Add constrained int->FP intrinsics.

I like the switch to using update_llc_test_checks.py. Sure, I'll rebase, run that script and it'll be in the next round of this patch when I can.

Nov 12 2019, 7:41 AM · Restricted Project

Nov 11 2019

kpn added a comment to D70096: [strictfp] Replace dangling strictfp attrs with nobuiltin.

Do we want to restrict this so it doesn't get upgraded if found in a future bitcode version?

Nov 11 2019, 12:12 PM · Restricted Project
kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Nov 11 2019, 11:44 AM · Restricted Project
kpn added reviewers for D68810: Document rounding for llvm.lround and llvm.lrint: andrew.w.kaylor, craig.topper, cameron.mcinally, efriedma.
Nov 11 2019, 10:13 AM · Restricted Project
kpn committed rG19bbdf6ca6be: Fix errors where we thought we were checking for labels but weren't due to use… (authored by kpn).
Fix errors where we thought we were checking for labels but weren't due to use…
Nov 11 2019, 9:36 AM
kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Address review comments. Add missing IR verifier pieces. Add the remaining test cases.

Nov 11 2019, 9:36 AM · Restricted Project

Nov 6 2019

kpn added inline comments to D69562: Mapping of FP operations to constrained intrinsics.
Nov 6 2019, 10:57 AM · Restricted Project
kpn added inline comments to D69562: Mapping of FP operations to constrained intrinsics.
Nov 6 2019, 10:27 AM · Restricted Project
kpn added inline comments to D69562: Mapping of FP operations to constrained intrinsics.
Nov 6 2019, 10:09 AM · Restricted Project

Nov 4 2019

kpn planned changes to D69616: [FPEnv] The inliner shouldn't mix strictfp and non-strictfp functions..

It looks like D69798 may be more complete patch. Let me take this off everyone's queue while that one is in flight.

Nov 4 2019, 7:40 AM · Restricted Project
kpn added inline comments to D69562: Mapping of FP operations to constrained intrinsics.
Nov 4 2019, 6:51 AM · Restricted Project
kpn added inline comments to D69798: Implement inlining of strictfp functions.
Nov 4 2019, 6:44 AM · Restricted Project
kpn added a comment to D69562: Mapping of FP operations to constrained intrinsics.

The IRBuilder handles mapping non-constrained operations to constrained operations already. So a front-end just needs to enable strict mode in the IRBuilder and most everything "just works". And clang uses the IRBuilder, so we're good there. Are you working on a front-end that doesn't use the IRBuilder?

Nov 4 2019, 5:51 AM · Restricted Project

Oct 31 2019

kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Oct 31 2019, 11:50 AM · Restricted Project
kpn planned changes to D69275: Add constrained int->FP intrinsics.

It looks like I am going to have to do some Custom lowering work after all. Plus the changes to the IR verifier are missing.

Oct 31 2019, 10:10 AM · Restricted Project

Oct 30 2019

kpn updated the diff for D69616: [FPEnv] The inliner shouldn't mix strictfp and non-strictfp functions..

Address review comment: rework comment to stand out.

Oct 30 2019, 11:31 AM · Restricted Project
kpn added inline comments to D69616: [FPEnv] The inliner shouldn't mix strictfp and non-strictfp functions..
Oct 30 2019, 11:31 AM · Restricted Project
kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Oct 30 2019, 11:21 AM · Restricted Project
kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Address review comments.

Oct 30 2019, 10:51 AM · Restricted Project
kpn committed rG72bc291f9459: [NFC] Move this set of STRICT_* cases to be next to the non-strict cases. (authored by kpn).
[NFC] Move this set of STRICT_* cases to be next to the non-strict cases.
Oct 30 2019, 10:35 AM
kpn added inline comments to D69275: Add constrained int->FP intrinsics.
Oct 30 2019, 7:19 AM · Restricted Project
kpn created D69616: [FPEnv] The inliner shouldn't mix strictfp and non-strictfp functions..
Oct 30 2019, 6:32 AM · Restricted Project

Oct 29 2019

kpn added a comment to D69275: Add constrained int->FP intrinsics.

This probably needs tests that will lower to single instructions. E.g. llvm.experimental.constrained.uitofp.v4f32.v4i32 should lower to a cvtps2dq on SSE2.

Maybe testing an AVX512VL target would be interesting too. They have really good support for different CVT variants.

Oct 29 2019, 7:30 AM · Restricted Project

Oct 25 2019

kpn updated the diff for D69275: Add constrained int->FP intrinsics.

Added missing documentation. Added a case I missed earlier.

Oct 25 2019, 1:06 PM · Restricted Project
kpn committed rGde79836312e0: [FPEnv] Teach the IRBuilder about correct use of the strictfp attribute. (authored by kpn).
[FPEnv] Teach the IRBuilder about correct use of the strictfp attribute.
Oct 25 2019, 10:07 AM
kpn closed D69312: [FPEnv] Teach the IRBuilder about correct use of the strictfp attribute..
Oct 25 2019, 10:07 AM · Restricted Project

Oct 23 2019

kpn planned changes to D69275: Add constrained int->FP intrinsics.

Lacks documentation. Sorry. I'm working on that now.

Oct 23 2019, 9:46 AM · Restricted Project
kpn committed rGb689cc640f3f: Minor movement of one function with now-correct strictfp attribute to pass… (authored by kpn).
Minor movement of one function with now-correct strictfp attribute to pass…
Oct 23 2019, 9:28 AM
kpn added a comment to D69312: [FPEnv] Teach the IRBuilder about correct use of the strictfp attribute..

What does the call attribute mean?

Oct 23 2019, 6:16 AM · Restricted Project