Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

ebevhan (Bevin Hansson)
User

Projects

User does not belong to any projects.

User Details

User Since
Jan 16 2018, 6:47 AM (297 w, 1 d)

Recent Activity

Aug 9 2023

ebevhan added a comment to D152081: [Attributor] Add lightweight version for attribute deduction only.

Hi! We're seeing miscompiles downstream when running attributor-light in pipelines. In the below reproducer, DSE is eliminating a store that isn't dead.

Aug 9 2023, 3:53 AM · Restricted Project, Restricted Project

May 23 2023

ebevhan added a comment to D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++.

Based on all this, I think we should go with __addrspace_cast as a named cast and not allow the conversion through reinterpret_cast unless going to/from a [u]intptr_t.

May 23 2023, 12:59 AM · Restricted Project, Restricted Project

May 22 2023

ebevhan added a comment to D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++.

I'd rather have an operation whose semantics are a little dangerous than something that doesn't work at all. As it stands we need to use C-style casts for this and I don't think there's a good reason to forbid this at least from the C++ standard point of view. For OpenCL where we have the concept of address spaces it makes sense, but not for C++.

May 22 2023, 10:03 AM · Restricted Project, Restricted Project
ebevhan added a comment to D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++.

You can have address spaced in freestanding C++, they just need to be assigned according to the backens, e.g. https://godbolt.org/z/ahazae6Ta. And I don't think that's a desirable solution because it would require a language extension to cover a use-case that isn't disallowed by the C++ standard anyway. I don't see a reason why we shouldn't be able to do this directly.

May 22 2023, 9:34 AM · Restricted Project, Restricted Project
ebevhan added a comment to D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++.

The problem is we don't have addrspace_cast in freestanding C++, so as it stands we currently have no way to perform this operation in C++ which is preventing me from implementing things in the LLVM LibC port for GPUs I'm working on.

May 22 2023, 7:45 AM · Restricted Project, Restricted Project
ebevhan added a comment to D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++.

What would be the semantics of such an operation if the address spaces are disjoint? Or, if the underlying pointer widths aren't the same?

It would most likely invalid, but I'm not asserting that clang should be responsible for diagnosing misuse in these cases. Especially because in generic freestanding C++ we don't have any language options to suggest the actual semantics.

May 22 2023, 7:33 AM · Restricted Project, Restricted Project
ebevhan added a comment to D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++.

What would be the semantics of such an operation if the address spaces are disjoint? Or, if the underlying pointer widths aren't the same?

May 22 2023, 6:52 AM · Restricted Project, Restricted Project

May 21 2023

ebevhan added a comment to D58346: [Sema] Change addr space diagnostics in casts to follow C++ style.

should C++ really be limited by OpenCL here?

May 21 2023, 11:43 PM · Restricted Project, Restricted Project

Sep 27 2022

ebevhan added a comment to D130510: Missing tautological compare warnings due to unary operators.

Hi! A bit of late feedback on this patch. We found a failure in our downstream testing likely originating from here.

Sep 27 2022, 12:12 AM · Restricted Project, Restricted Project

Jul 15 2022

ebevhan added a comment to D128732: [VectorCombine] Improve shuffle select shuffle-of-shuffles.

We get a memory corruption issue in our downstream testing with this patch. I've attached a reproducer, which can be run with opt -passes=vector-combine reduced.ll:

Jul 15 2022, 5:51 AM · Restricted Project, Restricted Project

Jul 14 2022

ebevhan added a comment to D62574: Add support for target-configurable address spaces..

Sorry for the delay! I rebased the patch onto latest and it mostly worked, with a few hitches.

Jul 14 2022, 7:03 AM · Restricted Project, Restricted Project, Restricted Project
ebevhan updated the diff for D62574: Add support for target-configurable address spaces..

Rebased and addressed some comments.

Jul 14 2022, 6:51 AM · Restricted Project, Restricted Project, Restricted Project

Jun 9 2022

ebevhan added a comment to D125862: [clang][driver] Add gcc-toolset/devtoolset 12 to prefixes.

Hi! This test is failing in some of our downstream builds.

Jun 9 2022, 2:15 AM · Restricted Project, Restricted Project

Jun 1 2022

ebevhan added a comment to D62574: Add support for target-configurable address spaces..

I've been away from LLVM development for a while, and sadly this patch has languished a bit.

Jun 1 2022, 6:55 AM · Restricted Project, Restricted Project, Restricted Project

Oct 13 2020

ebevhan committed rG101309fe048e: [AST] Change return type of getTypeInfoInChars to a proper struct instead of… (authored by ebevhan).
[AST] Change return type of getTypeInfoInChars to a proper struct instead of…
Oct 13 2020, 4:44 AM
ebevhan committed rG9fa7f4845976: [Fixed Point] Add fixed-point to floating point cast types and consteval. (authored by ebevhan).
[Fixed Point] Add fixed-point to floating point cast types and consteval.
Oct 13 2020, 4:44 AM
ebevhan closed D86447: [AST] Change return type of getTypeInfoInChars to a proper struct instead of std::pair..
Oct 13 2020, 4:44 AM · Restricted Project
ebevhan closed D86631: [Fixed Point] Add fixed-point to floating point cast types and consteval..
Oct 13 2020, 4:44 AM · Restricted Project

Oct 9 2020

ebevhan committed rGdd3014f3dc7c: [Fixed Point] Add floating point methods to APFixedPoint. (authored by ebevhan).
[Fixed Point] Add floating point methods to APFixedPoint.
Oct 9 2020, 1:31 AM
ebevhan committed rG9c26eb8b915e: Refactor fixed point conversion test. (authored by ebevhan).
Refactor fixed point conversion test.
Oct 9 2020, 1:31 AM
ebevhan committed rG14a217534b79: [IR] Add Type::getFloatingPointTy. (authored by ebevhan).
[IR] Add Type::getFloatingPointTy.
Oct 9 2020, 1:31 AM
ebevhan closed D85961: [Fixed Point] Add floating point methods to APFixedPoint..
Oct 9 2020, 1:31 AM · Restricted Project
ebevhan closed D88648: Refactor fixed point conversion test..
Oct 9 2020, 1:31 AM · Restricted Project
ebevhan closed D87512: [IR] Add Type::getFloatingPointTy..
Oct 9 2020, 1:31 AM · Restricted Project

Oct 1 2020

ebevhan requested review of D88648: Refactor fixed point conversion test..
Oct 1 2020, 4:40 AM · Restricted Project

Sep 30 2020

ebevhan added a comment to D54749: Saturating float to int casts..

It doesn't seem like anyone has any more immediate feedback. @efriedma, have all of your review comments been adequately addressed?

Sep 30 2020, 8:19 AM · Restricted Project

Sep 29 2020

ebevhan accepted D88174: [Sema] Address-space sensitive check for unbounded arrays (v2).

LGTM, but @aaron.ballman should probably give his two cents as well for completion's sake.

Sep 29 2020, 4:43 AM · Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Rebased.

Sep 29 2020, 2:43 AM · Restricted Project
ebevhan updated the diff for D54749: Saturating float to int casts..

Rebased.

Sep 29 2020, 2:43 AM · Restricted Project

Sep 25 2020

ebevhan added a comment to D86078: [AArch64] Improved lowering for saturating float to int..

Ping. The build failures don't seem related to the patch.

Sep 25 2020, 8:06 AM · Restricted Project
ebevhan added a comment to D54749: Saturating float to int casts..

Another gentle ping.

Sep 25 2020, 8:03 AM · Restricted Project

Sep 24 2020

ebevhan added a comment to D85961: [Fixed Point] Add floating point methods to APFixedPoint..

So is this patch good to go then?

Sep 24 2020, 8:23 AM · Restricted Project

Sep 23 2020

ebevhan added inline comments to D85961: [Fixed Point] Add floating point methods to APFixedPoint..
Sep 23 2020, 3:36 AM · Restricted Project

Sep 22 2020

ebevhan added inline comments to D85961: [Fixed Point] Add floating point methods to APFixedPoint..
Sep 22 2020, 6:16 AM · Restricted Project

Sep 21 2020

ebevhan added a comment to D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Ping.

Sep 21 2020, 4:28 AM · Restricted Project
ebevhan added a comment to D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..

Ping. Any further comments?

Sep 21 2020, 4:28 AM · Restricted Project, Restricted Project

Sep 15 2020

ebevhan added a comment to D54749: Saturating float to int casts..

Any more feedback on this?

Sep 15 2020, 6:59 AM · Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Fixed typos.

Sep 15 2020, 1:16 AM · Restricted Project

Sep 14 2020

ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Fix clang-format warnings.

Sep 14 2020, 7:45 AM · Restricted Project
ebevhan updated the diff for D54749: Saturating float to int casts..

Fix clang-format warnings.

Sep 14 2020, 7:35 AM · Restricted Project
ebevhan added inline comments to D86078: [AArch64] Improved lowering for saturating float to int..
Sep 14 2020, 6:24 AM · Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Now only uses FP_TO_INT_SAT nodes for lowering. The nodes are selected in isel.

Sep 14 2020, 6:19 AM · Restricted Project

Sep 11 2020

ebevhan updated the diff for D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..

Fix typo.

Sep 11 2020, 7:28 AM · Restricted Project, Restricted Project
ebevhan added inline comments to D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..
Sep 11 2020, 6:55 AM · Restricted Project, Restricted Project
ebevhan updated the diff for D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..

Using Type::getFloatingPointTy now.

Sep 11 2020, 6:53 AM · Restricted Project, Restricted Project
ebevhan requested review of D87512: [IR] Add Type::getFloatingPointTy..
Sep 11 2020, 6:52 AM · Restricted Project
ebevhan added inline comments to D86078: [AArch64] Improved lowering for saturating float to int..
Sep 11 2020, 2:19 AM · Restricted Project

Sep 10 2020

ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Use default expansion for f128 conversions; they aren't native so we can't be sure that they saturate.

Sep 10 2020, 6:13 AM · Restricted Project
ebevhan added inline comments to D86078: [AArch64] Improved lowering for saturating float to int..
Sep 10 2020, 5:54 AM · Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Removed NativeSaturation parameter and made all lowering happen in Lower.

Sep 10 2020, 5:51 AM · Restricted Project
ebevhan added inline comments to D86078: [AArch64] Improved lowering for saturating float to int..
Sep 10 2020, 5:36 AM · Restricted Project
ebevhan added inline comments to D86078: [AArch64] Improved lowering for saturating float to int..
Sep 10 2020, 3:03 AM · Restricted Project

Sep 9 2020

ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Redid lowering.

Sep 9 2020, 9:01 AM · Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Followup to removing vector expansion in the parent patch.

Sep 9 2020, 4:55 AM · Restricted Project
ebevhan updated the diff for D54749: Saturating float to int casts..

Removed vector expansion.

Sep 9 2020, 4:54 AM · Restricted Project
ebevhan updated the diff for D54749: Saturating float to int casts..

Fixed failing test cases.

Sep 9 2020, 2:19 AM · Restricted Project
ebevhan added a comment to D86078: [AArch64] Improved lowering for saturating float to int..

I would have experimented a little to understand better how things work, but I'm guessing the patch is based on other work because I couldn't some of the affected functions/nodes.

Sep 9 2020, 1:21 AM · Restricted Project

Sep 8 2020

ebevhan updated the diff for D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..

Updated method name.

Sep 8 2020, 9:11 AM · Restricted Project, Restricted Project
ebevhan updated the diff for D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Addressed comments.

Sep 8 2020, 9:10 AM · Restricted Project
ebevhan added inline comments to D85961: [Fixed Point] Add floating point methods to APFixedPoint..
Sep 8 2020, 9:10 AM · Restricted Project

Sep 7 2020

ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Removed superfluous NaN check and updated tests.

Sep 7 2020, 8:49 AM · Restricted Project
ebevhan added a comment to D54749: Saturating float to int casts..

I don't know why the premerge tests are failing. I don't see those failures locally, so it's rather hard to debug it, especially since the premerge build lacks proper debug info.

Sep 7 2020, 8:01 AM · Restricted Project
ebevhan updated the diff for D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..

Rebased.

Sep 7 2020, 5:46 AM · Restricted Project, Restricted Project
ebevhan updated the diff for D86631: [Fixed Point] Add fixed-point to floating point cast types and consteval..

Rebased.

Sep 7 2020, 5:46 AM · Restricted Project
ebevhan updated the diff for D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Rebased.

Sep 7 2020, 5:46 AM · Restricted Project
ebevhan updated the diff for D86079: [X86] Improved lowering for saturating float to int..

Rebased.

Sep 7 2020, 5:45 AM · Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Rebased.

Sep 7 2020, 5:42 AM · Restricted Project
ebevhan updated the diff for D54749: Saturating float to int casts..

Rebased.

Sep 7 2020, 5:42 AM · Restricted Project
ebevhan updated the diff for D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..

Added promotion mechanism.

Sep 7 2020, 4:46 AM · Restricted Project, Restricted Project
ebevhan updated the diff for D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Added a promotion mechanism to handle cases where the floating point type cannot be used to rescale the value.

Sep 7 2020, 4:45 AM · Restricted Project

Sep 4 2020

ebevhan added inline comments to D86796: [Sema] Address-space sensitive index check for unbounded arrays.
Sep 4 2020, 5:43 AM · Restricted Project
ebevhan added inline comments to D86796: [Sema] Address-space sensitive index check for unbounded arrays.
Sep 4 2020, 4:28 AM · Restricted Project
ebevhan added a comment to D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Would it be completely unthinkable to "promote" calculations to a larger FP type (both here and in codegen) if the exponent bits are insufficient to hold the necessary scaling?

You could have the same problem with float/bfloat and a 128-bit fixed-point type, right? 128-bit integer types aren't at all ridiculous. I think this is something you should accommodate properly in your design; I don't think it's that problematic.

Sep 4 2020, 2:28 AM · Restricted Project

Sep 3 2020

ebevhan added inline comments to D86796: [Sema] Address-space sensitive index check for unbounded arrays.
Sep 3 2020, 5:39 AM · Restricted Project

Sep 2 2020

ebevhan added inline comments to D62574: Add support for target-configurable address spaces..
Sep 2 2020, 5:18 AM · Restricted Project, Restricted Project, Restricted Project

Sep 1 2020

ebevhan added a comment to D62574: Add support for target-configurable address spaces..

The only thing is that it would be good to test the new target setting logic somehow... do you have any ideas in mind? We could think of creating a dummy target for that or adding a dummy setting in existing targets - maybe SPIR could be a candidate. We have done something similar in the past if you look at FakeAddrSpaceMap in LangOpts.

Sep 1 2020, 9:25 AM · Restricted Project, Restricted Project, Restricted Project
ebevhan updated the diff for D86078: [AArch64] Improved lowering for saturating float to int..

Made natively saturating expansions use integer comparisons instead.

Sep 1 2020, 8:01 AM · Restricted Project
ebevhan added inline comments to D86796: [Sema] Address-space sensitive index check for unbounded arrays.
Sep 1 2020, 7:13 AM · Restricted Project
ebevhan added a comment to D54749: Saturating float to int casts..

At least for the IEEE formats, you should be able to just destructure the bit-pattern of the float, right? Normalize and do some extends and shifts.

If we're going down that path, maybe simpler to just mess with the float scaling factor. If a float is close to the largest finite float, in IEEE formats, the fractional part must be zero. So we can do the float-to-int conversion on the unscaled float, and scale the resulting integer. Probably faster than trying to explicitly destructure a float.

Sep 1 2020, 6:33 AM · Restricted Project

Aug 31 2020

ebevhan updated the diff for D54749: Saturating float to int casts..

Addressed comments.

Aug 31 2020, 9:08 AM · Restricted Project

Aug 27 2020

ebevhan added a comment to D85961: [Fixed Point] Add floating point methods to APFixedPoint..

I hadn't considered half precision as that's sort of off my radar. That does make both these conversion methods and the corresponding codegen implementation rather problematic.

Aug 27 2020, 6:51 AM · Restricted Project
ebevhan added a comment to D54749: Saturating float to int casts..

I can't competently review LLVM code-gen patches, but I can review intrinsic design. If the intended use case here is fixed point, should there be a scale parameter rather than expecting the caller to scale the input? Or is scaling the input basically the expected implementation on all hardware? Scaling the input can be lossy if we overflow to infinity, so that would be making a tacit assumption here that if that happens, the original value must've been outside the representation range of the integer. For float (and bfloat), the exponent goes up to 127, so you would need to be converting to a pretty large fixed-point format to have problems with lossy overflow. For half, the exponent only goes up to 16, so converting to a 32-bit fixed-point format with a scale could overflow, and you probably won't be able to use these intrinsics.

Aug 27 2020, 2:32 AM · Restricted Project
ebevhan added inline comments to D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..
Aug 27 2020, 1:28 AM · Restricted Project, Restricted Project
ebevhan updated the diff for D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Fix comment mistake.

Aug 27 2020, 1:06 AM · Restricted Project
ebevhan retitled D85961: [Fixed Point] Add floating point methods to APFixedPoint. from Add floating point methods to APFixedPoint. to [Fixed Point] Add floating point methods to APFixedPoint..
Aug 27 2020, 1:03 AM · Restricted Project
ebevhan added a comment to D86677: [clang] Display error if _Fract fixed point literals overflow.

This needs a few tests.

Aug 27 2020, 1:02 AM

Aug 26 2020

ebevhan requested review of D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point..
Aug 26 2020, 8:37 AM · Restricted Project, Restricted Project
ebevhan requested review of D86631: [Fixed Point] Add fixed-point to floating point cast types and consteval..
Aug 26 2020, 8:36 AM · Restricted Project
ebevhan updated the diff for D85961: [Fixed Point] Add floating point methods to APFixedPoint..

Rebased and did minor adjustments.

Aug 26 2020, 8:31 AM · Restricted Project
ebevhan added a comment to D54749: Saturating float to int casts..

Missing globalisel support

Aug 26 2020, 7:16 AM · Restricted Project
ebevhan added a comment to D54749: Saturating float to int casts..

Ping.

Aug 26 2020, 3:39 AM · Restricted Project

Aug 25 2020

ebevhan added a reviewer for D86078: [AArch64] Improved lowering for saturating float to int.: nikic.

Given you are making use of the fact that AArch64 fp_to_int already does the saturation part, I'm wondering if the different-width saturation can be moved from the input to the output? Specially I'm thinking this will result in nicer code as the min/max immediate values will be easier to produce in integer form.

Aug 25 2020, 1:29 AM · Restricted Project

Aug 24 2020

ebevhan abandoned D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations..
Aug 24 2020, 8:36 AM · Restricted Project
ebevhan added a comment to D85961: [Fixed Point] Add floating point methods to APFixedPoint..

@gousemoodhin I just want to check; are you working on or planning to work on float-fixed support in the near future? Floating point conversions are the next step for the fixed-point support, so if you aren't immediately looking at it, I would like to take a shot at it.

Aug 24 2020, 6:29 AM · Restricted Project
ebevhan committed rG577f8b157a03: [Fixed Point] Add codegen for fixed-point shifts. (authored by ebevhan).
[Fixed Point] Add codegen for fixed-point shifts.
Aug 24 2020, 5:38 AM
ebevhan closed D83294: [Fixed Point] Add codegen for fixed-point shifts..
Aug 24 2020, 5:38 AM · Restricted Project
ebevhan committed rG808ac5464521: [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR. (authored by ebevhan).
[Fixed Point] Use FixedPointBuilder to codegen fixed-point IR.
Aug 24 2020, 5:38 AM
ebevhan closed D86282: [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR..
Aug 24 2020, 5:38 AM · Restricted Project
ebevhan requested review of D86447: [AST] Change return type of getTypeInfoInChars to a proper struct instead of std::pair..
Aug 24 2020, 5:12 AM · Restricted Project
ebevhan added a reviewer for D86078: [AArch64] Improved lowering for saturating float to int.: paulwalker-arm.
Aug 24 2020, 1:50 AM · Restricted Project