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 (82 w, 2 d)

Recent Activity

Mon, Sep 16

kpn added a comment to D64746: Add constrained intrinsics for lrint and lround.

Ping.

Mon, Sep 16, 9:16 AM · Restricted Project

Fri, Sep 13

kpn committed rGed73d4aba87d: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non… (authored by kpn).
[FPEnv] Document that constrained FP intrinsics cannot be mixed with non…
Fri, Sep 13, 12:36 PM
kpn committed rL371888: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non….
[FPEnv] Document that constrained FP intrinsics cannot be mixed with non…
Fri, Sep 13, 12:35 PM
kpn closed D67360: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained.
Fri, Sep 13, 12:34 PM · Restricted Project
kpn updated the diff for D67360: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained.

Incorporate changes and text requested by Andrew Kaylor. Remove mention of the lack of barriers and include text on how to accomplish mixing without barriers.

Fri, Sep 13, 6:46 AM · Restricted Project

Thu, Sep 12

kpn updated the diff for D67360: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained.

Address review comment. Mention the possibility of the restrictions mentioned here changing in the future, but don't make any promises.

Thu, Sep 12, 9:24 AM · Restricted Project
kpn added a comment to D67360: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained.

My understanding was that this is a temporary restriction; in the end, the goal is to allow mixing constrained an non-constrained operations, once we have the necessary barriers. Did I misunderstand this?

Now, I guess it still makes sense to document the restriction even if it is temporary, I'm just wondering whether this should be made explicit in the docs.

Thu, Sep 12, 8:11 AM · Restricted Project

Mon, Sep 9

kpn created D67360: [FPEnv] Document that constrained FP intrinsics cannot be mixed with non-constrained.
Mon, Sep 9, 9:54 AM · Restricted Project

Fri, Sep 6

kpn added a comment to D67105: [TargetLowering] Fix another potential FPE in expandFP_TO_UINT.

Well, I like it. The problem is solved, the pseudocode is I find a little easier to read, and the System/Z instruction sequence looks like a sideways move performance-wise.

Fri, Sep 6, 12:10 PM · Restricted Project
kpn committed rGfab40fce3ffe: [FPEnv] Teach the IRBuilder about constrained FPToSI and FPToUI. (authored by kpn).
[FPEnv] Teach the IRBuilder about constrained FPToSI and FPToUI.
Fri, Sep 6, 11:05 AM
kpn committed rL371235: [FPEnv] Teach the IRBuilder about constrained FPToSI and FPToUI..
[FPEnv] Teach the IRBuilder about constrained FPToSI and FPToUI.
Fri, Sep 6, 11:03 AM
kpn closed D67291: Teach the IRBuilder about constrained FPToSI and FPToUI.
Fri, Sep 6, 11:03 AM · Restricted Project
kpn created D67291: Teach the IRBuilder about constrained FPToSI and FPToUI.
Fri, Sep 6, 10:42 AM · Restricted Project

Wed, Sep 4

kpn added a comment to D67105: [TargetLowering] Fix another potential FPE in expandFP_TO_UINT.

Ah, good point. Currently, constrained floating-point intrinsics are never constant-folded. In general, this would likely be wrong anyway, since we might not know the current rounding mode that applies.

However, in the specific case of a fptoui, we don't depend on the current rounding mode (it's always round-to-zero even for the constrained case), so we actually could constant fold those in the cases where we the result is in range.

@kpn -- the test cases you added specifically verify that constrained fptoui does not constant-fold but does the runtime conversion. Should those be changed to use nonconstant arguments then?

Wed, Sep 4, 9:59 AM · Restricted Project

Thu, Aug 29

kpn updated the diff for D64746: Add constrained intrinsics for lrint and lround.

Address review comments.

Thu, Aug 29, 10:07 AM · Restricted Project

Wed, Aug 28

kpn added inline comments to D64746: Add constrained intrinsics for lrint and lround.
Wed, Aug 28, 9:44 AM · Restricted Project
kpn committed rGddf13c00edf1: [FPEnv] Add fptosi and fptoui constrained intrinsics. (authored by kpn).
[FPEnv] Add fptosi and fptoui constrained intrinsics.
Wed, Aug 28, 9:35 AM
kpn committed rL370228: [FPEnv] Add fptosi and fptoui constrained intrinsics..
[FPEnv] Add fptosi and fptoui constrained intrinsics.
Wed, Aug 28, 9:35 AM
kpn closed D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Wed, Aug 28, 9:35 AM · Restricted Project

Tue, Aug 27

kpn added inline comments to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Tue, Aug 27, 9:32 AM · Restricted Project

Aug 19 2019

kpn updated the diff for D64746: Add constrained intrinsics for lrint and lround.

Tweak documentation hopefully as requested. Remove a stray blank line that somehow got in there.

Aug 19 2019, 9:37 AM · Restricted Project
kpn added a comment to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

Ping

Aug 19 2019, 8:09 AM · Restricted Project
kpn added a comment to D62731: [RFC] Add support for options -frounding-math, -fp-model=, and -fp-exception-behavior=, : Specify floating point behavior.

I don't believe I have any further comments. What do the front-end guys say?

Aug 19 2019, 5:54 AM · Restricted Project

Aug 15 2019

kpn added inline comments to D62731: [RFC] Add support for options -frounding-math, -fp-model=, and -fp-exception-behavior=, : Specify floating point behavior.
Aug 15 2019, 11:54 AM · Restricted Project
kpn accepted D66078: Added RAII object for authomatic restore of fp state.

John already gave his go-ahead, and I'm adding my LGTM.

Aug 15 2019, 4:36 AM · Restricted Project

Aug 14 2019

kpn added inline comments to D66078: Added RAII object for authomatic restore of fp state.
Aug 14 2019, 6:33 AM · Restricted Project

Aug 12 2019

kpn added inline comments to D66078: Added RAII object for authomatic restore of fp state.
Aug 12 2019, 10:13 AM · Restricted Project
kpn accepted D66073: Added unit tests to check supported rounding modes.

LGTM

Aug 12 2019, 9:57 AM · Restricted Project
kpn added a comment to D66092: [CodeGen] Generate constrained fp intrinsics depending on FPOptions.

Does this work for anything that uses TreeTransform, like C++ templates?

Aug 12 2019, 9:36 AM · Restricted Project

Aug 9 2019

kpn added a comment to D65303: [BPI] Adjust the probability for floating point unordered comparison.

What will this do to software that does frequently use NaNs and doesn't treat them as exceptional?

Aug 9 2019, 11:58 AM · Restricted Project
kpn updated the diff for D64746: Add constrained intrinsics for lrint and lround.

Address review comments.

Aug 9 2019, 9:26 AM · Restricted Project
kpn added a comment to D65994: Extended FPOptions with new attributes.

In general, this seems reasonable, but is missing test code.

Aug 9 2019, 8:15 AM · Restricted Project
kpn added inline comments to D65997: Add options rounding and exceptions to pragma fp.
Aug 9 2019, 8:10 AM · Restricted Project

Aug 6 2019

kpn updated the diff for D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

Address review comments. Rebase.

Aug 6 2019, 9:53 AM · Restricted Project

Aug 5 2019

kpn added a comment to D65226: [Strict FP] Allow custom operation actions.

Ping?

Should we move ahead with this? I believe this is still a pre-req for D63782 ...

Aug 5 2019, 10:49 AM · Restricted Project

Jul 26 2019

kpn added a comment to D62731: [RFC] Add support for options -frounding-math, -fp-model=, and -fp-exception-behavior=, : Specify floating point behavior.

I actually don't have much of an opinion on what the command line argument form should be. It may be helpful for it to be the same as one of the commonly deployed compilers. The worst I think would be pretty close but with subtle differences. So if it can be made to work like Intel's compiler I'm fine with that. But I'm hoping that more people in the community chime in since having a consensus would be best. Personally, I'm not yet giving any final sign-offs to tickets since I don't think I've been here long enough.

Jul 26 2019, 12:39 PM · Restricted Project
kpn added inline comments to D65226: [Strict FP] Allow custom operation actions.
Jul 26 2019, 11:29 AM · Restricted Project
kpn added inline comments to D65226: [Strict FP] Allow custom operation actions.
Jul 26 2019, 9:19 AM · Restricted Project

Jul 25 2019

kpn added a comment to D65226: [Strict FP] Allow custom operation actions.

So the PowerPC code regressions will be fixed once the strict tickets make it into the tree it sounds like.

Jul 25 2019, 11:58 AM · Restricted Project
kpn added a comment to D62731: [RFC] Add support for options -frounding-math, -fp-model=, and -fp-exception-behavior=, : Specify floating point behavior.

I think it would be convenient to have an "unset" setting for the different constrained modes, otherwise you need a boolean that says "no value was provided for this option". But i'm a frontend person so I may need to have my attitude adjusted.

Jul 25 2019, 10:09 AM · Restricted Project

Jul 24 2019

kpn added a comment to D65226: [Strict FP] Allow custom operation actions.

It looks like we're unrolling some vectors where before we weren't. That seems unfortunate. Is that the reason for the generated code quality regressions?

Jul 24 2019, 11:51 AM · Restricted Project
kpn added inline comments to D65226: [Strict FP] Allow custom operation actions.
Jul 24 2019, 11:41 AM · Restricted Project
kpn updated the diff for D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.

Address review comments.

Jul 24 2019, 10:58 AM · Restricted Project

Jul 18 2019

kpn added inline comments to D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Jul 18 2019, 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
Jul 18 2019, 11:04 AM
kpn committed rL366477: [FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt.
[FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt
Jul 18 2019, 11:01 AM
kpn closed D64934: Teach the IRBuilder about constrained FPTrunc and FPExt.
Jul 18 2019, 11:01 AM · Restricted Project
kpn added a comment to D64934: Teach the IRBuilder about constrained FPTrunc and FPExt.

Thanks for the fast review!

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

Jul 17 2019

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

Jul 16 2019

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

Jul 15 2019

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

Jul 12 2019

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?

Jul 12 2019, 10:01 AM · Restricted Project

Jul 9 2019

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

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

Jul 9 2019, 8:14 AM · Restricted Project

Jul 8 2019

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?

Jul 8 2019, 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.
Jul 8 2019, 9:20 AM
kpn committed rL365339: Teach the IRBuilder about fadd and friends..
Teach the IRBuilder about fadd and friends.
Jul 8 2019, 9:20 AM
kpn closed D53157: Teach the IRBuilder about constrained fadd and friends.
Jul 8 2019, 9:20 AM · Restricted Project

Jul 3 2019

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.

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

Jul 1 2019

kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Jul 1 2019, 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.

Jul 1 2019, 10:56 AM · Restricted Project

Jun 27 2019

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.

Jun 27 2019, 6:06 AM · Restricted Project

Jun 26 2019

kpn added inline comments to D53157: Teach the IRBuilder about constrained fadd and friends.
Jun 26 2019, 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.

Jun 26 2019, 9:50 AM · Restricted Project

Jun 25 2019

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

Replaced by D63782.

Jun 25 2019, 11:57 AM
kpn created D63782: [FPEnv] Add fptosi and fptoui constrained intrinsics.
Jun 25 2019, 11:56 AM · Restricted Project
kpn committed rL364328: [FPEnv] A missing crucial step was undocumented..
[FPEnv] A missing crucial step was undocumented.
Jun 25 2019, 9:32 AM
kpn committed rGd0f96be2c781: [FPEnv] A missing crucial step was undocumented. (authored by kpn).
[FPEnv] A missing crucial step was undocumented.
Jun 25 2019, 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