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 (73 w, 5 d)

Recent Activity

Thu, Jul 18

kpn added inline comments to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Thu, Jul 18, 11:38 AM · Restricted Project
kpn committed rGd91998a5ac5e: [FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt (authored by kpn).
[FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt
Thu, Jul 18, 11:04 AM
kpn committed rL366477: [FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt.
[FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt
Thu, Jul 18, 11:01 AM
kpn closed D64934: Teach the IRBuilder about constrained FPTrunc and FPExt.
Thu, Jul 18, 11:01 AM · Restricted Project
kpn added a comment to D64934: Teach the IRBuilder about constrained FPTrunc and FPExt.

Thanks for the fast review!

Thu, Jul 18, 10:59 AM · Restricted Project
kpn added inline comments to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Thu, Jul 18, 10:54 AM · Restricted Project
kpn created D64934: Teach the IRBuilder about constrained FPTrunc and FPExt.
Thu, Jul 18, 9:57 AM · Restricted Project

Wed, Jul 17

kpn added inline comments to D64746: Add constrained intrinsics for lrint and lround.
Wed, Jul 17, 6:07 AM · Restricted Project

Tue, Jul 16

kpn added inline comments to D64746: Add constrained intrinsics for lrint and lround.
Tue, Jul 16, 11:17 AM · Restricted Project
kpn added inline comments to D64746: Add constrained intrinsics for lrint and lround.
Tue, Jul 16, 7:38 AM · Restricted Project

Mon, Jul 15

kpn added a reviewer for D64746: Add constrained intrinsics for lrint and lround: cameron.mcinally.
Mon, Jul 15, 10:01 AM · Restricted Project
kpn updated subscribers of D64746: Add constrained intrinsics for lrint and lround.
Mon, Jul 15, 8:00 AM · Restricted Project
kpn created D64746: Add constrained intrinsics for lrint and lround.
Mon, Jul 15, 8:00 AM · Restricted Project

Fri, Jul 12

kpn added a comment to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

How aggressive is LLVM's UB handling? Would it remove an entire block/function if UB is found in it?

If LLVM can prove a basic block unconditionally executes UB, it will be erased. But "unconditionally" is an important qualifier. For example, consider the following function: void f(void g()) { g(); *(int*)0 = 0; }. The call to g isn't erased because we can't prove g will return.

The constrained FP intrinsics should be opaque enough (besides 'ignore'), so that sounds fine to me.

Seems like we should let invalid fptoXi's return poison, like the unconstrained versions do. Anyone see a problem with this?

Fri, Jul 12, 10:01 AM · Restricted Project

Tue, Jul 9

kpn added a comment to D64412: [Strict FP] Allow more relaxed scheduling.

Stupid question: what's a "global barrier"?

Tue, Jul 9, 8:14 AM · Restricted Project

Mon, Jul 8

kpn added a comment to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

I might be opening a can of worms here and I'm not a language expert, but it isn't clear to me from reading the C99 standard that defining fptosi/fptoui as returning poison values in the unrepresentable case allows correct implementation of the C standard. That is, it doesn't seem to me that the standard actually says this is undefined behavior. It just says the resulting value is unspecified, and the exception behavior is explicitly defined. On the other hand, C++ does say clearly that it is undefined behavior, right?

I understand that in the unconstrained case LLVM doesn't care about FP exceptions and that we would like the LLVM IR definition to be more precise than the C standard. I'm just trying to get my head wrapped around why we're doing what we are in that case and what we need to do to correctly implement strict FP semantics.

If we say that the constrained version returns undef in the unrepresentable case and clearly emphasize how this differs from the standard fptosi/fptoui instructions, would that have the effect of keeping the operation around so that it can raise the exception while still giving us well-defined IR semantics?

Mon, Jul 8, 9:26 AM · Restricted Project
kpn committed rG472e5dda110f: Teach the IRBuilder about fadd and friends. (authored by kpn).
Teach the IRBuilder about fadd and friends.
Mon, Jul 8, 9:20 AM
kpn committed rL365339: Teach the IRBuilder about fadd and friends..
Teach the IRBuilder about fadd and friends.
Mon, Jul 8, 9:20 AM
kpn closed D53157: Teach the IRBuilder about constrained fadd and friends.
Mon, Jul 8, 9:20 AM · Restricted Project

Wed, Jul 3

kpn updated the diff for D53157: Teach the IRBuilder about constrained fadd and friends.

I was convinced in email that having the constrained intrinsics take fast math flags could be useful in some circumstances. The example that was given was that perhaps FMA contraction could be requested. So, when generating constrained intrinsics the fast math flags and the FP metadata is now handled exactly the same as in non-constrained mode. I've updated the documentation to warn about that when turning constrained mode on and off.

Wed, Jul 3, 10:32 AM · Restricted Project
kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Wed, Jul 3, 10:24 AM · Restricted Project

Mon, Jul 1

kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Mon, Jul 1, 12:12 PM · Restricted Project
kpn updated the diff for D53157: Teach the IRBuilder about constrained fadd and friends.

Address review comments. Eliminate ConstrainedFPIntrinsic's ebInvalid and rmInvalid enumeration values and replace them with use of the Optional<> class. Adjust the rest of the patch to take that into account. ConstrainedFPIntrinsic now supports string <--> enum conversions.

Mon, Jul 1, 10:56 AM · Restricted Project

Thu, Jun 27

kpn added a comment to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

So pragmatically, an invalid exception is an alarm that the code is off track. As long as the exception is handled appropriately (default or an alternative), the result of the invalid operation shouldn't matter. Whatever LLVM wants to do with the value gets no arguments from me, since we've already self-destructed (unless the program handles the exception gracefully, but that wouldn't require a defined result from the invalid operation anyway).

But the exception could be masked couldn't it?

Yeah, but I'm not sure if it matters. The program has already failed, so there's no guarantee that the results are useful.

Our typical user enables traps (inv, divz, and ovf) during development to convince themselves that the code is safe. Production runs are then done with traps disabled. But, of course, traps may be reenabled if a runtime problem is later found. They're basically a sanity check.

Thu, Jun 27, 6:06 AM · Restricted Project

Wed, Jun 26

kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Wed, Jun 26, 11:22 AM · Restricted Project
kpn added a comment to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

What happens if the input float is out of range? fptosi/fptoui instructions produce poison; not sure if you want that here.

Wed, Jun 26, 9:50 AM · Restricted Project

Tue, Jun 25

kpn abandoned D43515: More math intrinsics for conservative math handling.

Replaced by D63782.

Tue, Jun 25, 11:57 AM
kpn created D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Tue, Jun 25, 11:56 AM · Restricted Project
kpn committed rL364328: [FPEnv] A missing crucial step was undocumented..
[FPEnv] A missing crucial step was undocumented.
Tue, Jun 25, 9:32 AM
kpn committed rGd0f96be2c781: [FPEnv] A missing crucial step was undocumented. (authored by kpn).
[FPEnv] A missing crucial step was undocumented.
Tue, Jun 25, 9:31 AM

Jun 20 2019

kpn added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

I found out that some compilers, including SAS/C, will warn about enum overlaps like the one here under discussion. So I now believe John is correct and that eliminating that overlap is the right thing to do. Over the weekend I'll be thinking about whether or not to try and find an alternative, but I'll be out of cell phone range until late Sunday evening.

Jun 20 2019, 8:45 AM · Restricted Project

Jun 18 2019

kpn added a reviewer for D53157: Teach the IRBuilder about constrained fadd and friends: andrew.w.kaylor.
Jun 18 2019, 12:23 PM · Restricted Project
kpn added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

Andy, can I get you to chime in?

Jun 18 2019, 12:23 PM · Restricted Project
kpn added a comment to D43515: More math intrinsics for conservative math handling.

How would you feel about rebooting this as a new patch? There's a lot of irrelevant history here, and I feel like I'm missing some context as I review it.

Jun 18 2019, 11:08 AM
kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Jun 18 2019, 10:58 AM · Restricted Project
kpn updated the diff for D53157: Teach the IRBuilder about constrained fadd and friends.

Add static methods to convert between a StringRef and the enums for RoundingMode or ExceptionBehavior.

Jun 18 2019, 9:09 AM · Restricted Project

Jun 17 2019

kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Jun 17 2019, 1:07 PM · Restricted Project
kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Jun 17 2019, 12:45 PM · Restricted Project
kpn updated the diff for D53157: Teach the IRBuilder about constrained fadd and friends.

Address review comments.

Jun 17 2019, 12:45 PM · Restricted Project
kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Jun 17 2019, 10:11 AM · Restricted Project
kpn added a reviewer for D53157: Teach the IRBuilder about constrained fadd and friends: rjmccall.
Jun 17 2019, 8:14 AM · Restricted Project
kpn added a comment to D43515: More math intrinsics for conservative math handling.

Ping

Jun 17 2019, 6:22 AM
kpn added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

Ping.

Jun 17 2019, 6:22 AM · Restricted Project

Jun 14 2019

kpn committed rGfece7c6c8313: [FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of… (authored by kpn).
[FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of…
Jun 14 2019, 9:28 AM
kpn committed rL363417: [FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of….
[FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of…
Jun 14 2019, 9:28 AM
kpn closed D63271: [FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of ISelLowering to mirror non-strict nodes on x86..
Jun 14 2019, 9:28 AM · Restricted Project

Jun 10 2019

kpn added a comment to D43515: More math intrinsics for conservative math handling.

Ping.

Jun 10 2019, 7:14 AM

Jun 5 2019

kpn abandoned D61447: [FPEnv] WIP on threading fneg through llvm.

I don't think this needs to be open anymore.

Jun 5 2019, 6:19 AM · Restricted Project

Jun 4 2019

kpn updated the diff for D53157: Teach the IRBuilder about constrained fadd and friends.

Address the rest of the review comments, hopefully.

Jun 4 2019, 11:04 AM · Restricted Project

May 31 2019

kpn added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

Oh, this ticket is not going to die from neglect. It is true that D43515 is a higher priority, but I need this IRBuilder work done as well. My department head wanted it done by the end of _last_ year. It's not going to die.

May 31 2019, 9:52 AM · Restricted Project
kpn committed rGac79007205ef: Revert revert of r362112 with minor SystemZ test file corrections. (authored by kpn).
Revert revert of r362112 with minor SystemZ test file corrections.
May 31 2019, 9:32 AM
kpn committed rL362241: Revert revert of r362112 with minor SystemZ test file corrections..
Revert revert of r362112 with minor SystemZ test file corrections.
May 31 2019, 9:32 AM
kpn added inline comments to D62730: [RFC] Alternate implementation of D53157 IRBuilder for Constrained FP using enumeration vs MDNode and add support for fp-model and fp-speculation language options.
May 31 2019, 8:15 AM · Restricted Project
kpn added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

I wanted to get the API straight before working on documentation.

May 31 2019, 8:08 AM · Restricted Project
kpn added a comment to D62730: [RFC] Alternate implementation of D53157 IRBuilder for Constrained FP using enumeration vs MDNode and add support for fp-model and fp-speculation language options.

Incorporating feedback from D53157 is probably a good idea. Looks like that hasn't been done yet here completely.

May 31 2019, 7:56 AM · Restricted Project
kpn updated the diff for D53157: Teach the IRBuilder about constrained fadd and friends.

Address review comments.

May 31 2019, 7:55 AM · Restricted Project

May 30 2019

kpn added a reviewer for D43515: More math intrinsics for conservative math handling: kbarton.
May 30 2019, 11:48 AM
kpn committed rG51ce0b196a8b: Correct error in revert of r362112. (authored by kpn).
Correct error in revert of r362112.
May 30 2019, 11:13 AM
kpn committed rGd3db7b40b053: Revert r362112, it broke the bots with the message "Unsupported vector argument… (authored by kpn).
Revert r362112, it broke the bots with the message "Unsupported vector argument…
May 30 2019, 11:13 AM
kpn committed rL362118: Correct error in revert of r362112..
Correct error in revert of r362112.
May 30 2019, 11:13 AM
kpn committed rL362117: Revert r362112, it broke the bots with the message "Unsupported vector argument….
Revert r362112, it broke the bots with the message "Unsupported vector argument…
May 30 2019, 11:13 AM
kpn committed rG2e1807678d4d: [FPEnv] Added a special UnrollVectorOp method to deal with the chain on… (authored by kpn).
[FPEnv] Added a special UnrollVectorOp method to deal with the chain on…
May 30 2019, 11:12 AM
kpn committed rL362112: [FPEnv] Added a special UnrollVectorOp method to deal with the chain on….
[FPEnv] Added a special UnrollVectorOp method to deal with the chain on…
May 30 2019, 11:12 AM
kpn closed D62546: [FPEnv] Added a special UnrollVectorOp method to deal with the chain on StrictFP opcodes.
May 30 2019, 11:12 AM · Restricted Project

May 29 2019

kpn updated the diff for D43515: More math intrinsics for conservative math handling.

Address review comments from here and from D55897.

May 29 2019, 9:41 AM
kpn committed rG308b7139b1d8: Partial revert of revert of r361827: Add constrained intrinsic tests for… (authored by kpn).
Partial revert of revert of r361827: Add constrained intrinsic tests for…
May 29 2019, 9:30 AM
kpn committed rL361985: Partial revert of revert of r361827: Add constrained intrinsic tests for….
Partial revert of revert of r361827: Add constrained intrinsic tests for…
May 29 2019, 9:26 AM

May 28 2019

kpn committed rG71f8f745b412: Revert 361827. It broke the bots. (authored by kpn).
Revert 361827. It broke the bots.
May 28 2019, 7:40 AM
kpn committed rL361831: Revert 361827. It broke the bots..
Revert 361827. It broke the bots.
May 28 2019, 7:35 AM
kpn added a reverting change for rL361827: Add constrained intrinsic tests for powerpc64 and powerpc64le.: rL361831: Revert 361827. It broke the bots..
May 28 2019, 7:35 AM
kpn committed rG6d458fa86631: Add constrained intrinsic tests for powerpc64 and powerpc64le. (authored by kpn).
Add constrained intrinsic tests for powerpc64 and powerpc64le.
May 28 2019, 7:19 AM
kpn committed rL361827: Add constrained intrinsic tests for powerpc64 and powerpc64le..
Add constrained intrinsic tests for powerpc64 and powerpc64le.
May 28 2019, 7:15 AM
kpn closed D62388: [FPEnv] PowerPC Vector Constrained FP Intrinsics Test.
May 28 2019, 7:15 AM · Restricted Project

May 24 2019

kpn added a comment to D62388: [FPEnv] PowerPC Vector Constrained FP Intrinsics Test.

Drew is working with me here at SAS Institute, Inc.

May 24 2019, 12:16 PM · Restricted Project

May 21 2019

kpn updated subscribers of D43515: More math intrinsics for conservative math handling.
May 21 2019, 6:28 AM

May 15 2019

kpn added a comment to D53157: Teach the IRBuilder about constrained fadd and friends.

I'm waiting for a signoff from at least one front-end guy. I hope the mode setting that allows us to keep front ends from having to touch every use of the IRBuilder is something that works for clang. But I haven't heard anything from @rsmith or any other front-end person.

May 15 2019, 1:14 PM · Restricted Project
kpn added a comment to D43515: More math intrinsics for conservative math handling.

The only thing left in this ticket to commit is the fptosi and fptoui changes. I'm working on incorporating review comments from D55897 into this ticket and fixing other bugs that I'm coming across. I'll hopefully update this ticket next week.

May 15 2019, 10:55 AM
kpn added a comment to D61916: Teach InstSimplify transform -X + X --> 0.0 about unary FNeg.

If I recall, fneg is not a constrained intrinsic because an fneg will never itself trap.

May 15 2019, 9:39 AM · Restricted Project
kpn added a comment to D61916: Teach InstSimplify transform -X + X --> 0.0 about unary FNeg.

Is this an allowed transform?

May 15 2019, 5:38 AM · Restricted Project

May 13 2019

kpn committed rG5987749e33bb: Add constrained fptrunc and fpext intrinsics. (authored by kpn).
Add constrained fptrunc and fpext intrinsics.
May 13 2019, 6:24 AM
kpn committed rL360581: Add constrained fptrunc and fpext intrinsics..
Add constrained fptrunc and fpext intrinsics.
May 13 2019, 6:21 AM
kpn closed D55897: Add constrained fptrunc and fpext intrinsics.
May 13 2019, 6:21 AM · Restricted Project

May 10 2019

kpn added a comment to D55897: Add constrained fptrunc and fpext intrinsics.

Excellent. Thank you for all the reviews! I will commit this on Monday morning so I can keep an eye on the bots.

May 10 2019, 1:43 PM · Restricted Project
kpn updated the diff for D55897: Add constrained fptrunc and fpext intrinsics.

Address review comments.

May 10 2019, 1:31 PM · Restricted Project
kpn updated subscribers of D53157: Teach the IRBuilder about constrained fadd and friends.
May 10 2019, 12:35 PM · Restricted Project
kpn updated subscribers of D43515: More math intrinsics for conservative math handling.
May 10 2019, 12:32 PM
kpn updated subscribers of D55897: Add constrained fptrunc and fpext intrinsics.
May 10 2019, 12:32 PM · Restricted Project
kpn added a reviewer for D53157: Teach the IRBuilder about constrained fadd and friends: rsmith.
May 10 2019, 10:18 AM · Restricted Project

May 9 2019

kpn updated the diff for D55897: Add constrained fptrunc and fpext intrinsics.

Why does Verifier::visitIntrinsicCall() not choke when given an intrinsic it doesn't know about?

May 9 2019, 12:57 PM · Restricted Project
kpn updated the diff for D55897: Add constrained fptrunc and fpext intrinsics.

Address review comments: Add a comment as requested. Remove bogus optimizations to let the base case work. Update tests.

May 9 2019, 9:46 AM · Restricted Project

May 3 2019

kpn added a comment to D61447: [FPEnv] WIP on threading fneg through llvm.

@spatel I'm not a PatternMatch expert, but I think that change is what we wanted. That is, to continue to match FSub(-0.0, X) as an FNeg(X).

Just FYI that an equivalent patch was made to the PatternMatcher in D61520. I needed this for some FNeg constant folding work. Thanks for the inspirations, Kevin.

May 3 2019, 9:54 AM · Restricted Project

May 2 2019

kpn created D61447: [FPEnv] WIP on threading fneg through llvm.
May 2 2019, 9:24 AM · Restricted Project

May 1 2019

kpn added inline comments to D55897: Add constrained fptrunc and fpext intrinsics.
May 1 2019, 10:07 AM · Restricted Project

Apr 29 2019

kpn updated the diff for D55897: Add constrained fptrunc and fpext intrinsics.

Address review comments.

Apr 29 2019, 9:50 AM · Restricted Project
kpn committed rGa25c92830219: Add AVX support to this test. (authored by kpn).
Add AVX support to this test.
Apr 29 2019, 9:05 AM
kpn committed rL359461: Add AVX support to this test..
Add AVX support to this test.
Apr 29 2019, 9:04 AM

Apr 26 2019

kpn added inline comments to D55897: Add constrained fptrunc and fpext intrinsics.
Apr 26 2019, 7:58 AM · Restricted Project

Apr 25 2019

kpn updated the diff for D55897: Add constrained fptrunc and fpext intrinsics.

Address review comments.

Apr 25 2019, 11:20 AM · Restricted Project

Apr 17 2019

kpn added a comment to D57504: RFC: Prototype & Roadmap for vector predication in LLVM.

Would it make sense to also update docs/AddingConstrainedIntrinsics.rst please?

Apr 17 2019, 12:28 PM · Restricted Project
kpn added inline comments to D55897: Add constrained fptrunc and fpext intrinsics.
Apr 17 2019, 9:47 AM · Restricted Project