ebevhan (Bevin Hansson)
User

Projects

User does not belong to any projects.

User Details

User Since
Jan 16 2018, 6:47 AM (36 w, 15 h)

Recent Activity

Today

ebevhan added inline comments to D52286: [Intrinsic] Signed Saturation Intirnsic.
Tue, Sep 25, 1:20 AM

Yesterday

ebevhan added a comment to D52306: [DAGCombine] Don't fold dependent loads across SELECT_CC..

Oh, sorry. I should have mentioned that. That would be nice, thanks!

Mon, Sep 24, 11:55 PM

Fri, Sep 21

ebevhan added a comment to D52286: [Intrinsic] Signed Saturation Intirnsic.

So if I understand this correctly, we can handle this intrinsic in 2 ways:

  1. The intrinsic gets converted to IR in a pass before touching the DAG.
  2. The intrinsic gets passed to the DAG and gets legalized and lowered to machine code there.

It seems that from the thread, the consensus was for going with (2), but I also see now how things would be much easier just having this run through a pass in (1). If I recall correctly, the main reason for offsetting the intrinsic "expansion" to the DAG was to determine if the intrinsic was supported by the hardware during the legalization steps. If so, couldn't this also be done in a pass when converting the intrinsic to IR in (1)? That is, we determine early in the pass if this intrinsic call is supported by this target. Those that aren't legal get expanded into IR whereas those that are legal get passed to DAG instruction selection.

I think this might avoid the trouble of having to check types and operations in the DAG, and ISel can choose whatever appropriate instructions for whatever supported intrinsic (if that makes sense).

Fri, Sep 21, 2:06 AM

Thu, Sep 20

ebevhan added a reviewer for D52306: [DAGCombine] Don't fold dependent loads across SELECT_CC.: niravd.
Thu, Sep 20, 7:53 AM
ebevhan created D52306: [DAGCombine] Don't fold dependent loads across SELECT_CC..
Thu, Sep 20, 7:53 AM
ebevhan added a comment to D51211: [Sema] Emit -Wformat properly for bitfield promotions..

Another ping. Anyone up for reviewing this patch?

Thu, Sep 20, 6:30 AM
ebevhan added a comment to D52286: [Intrinsic] Signed Saturation Intirnsic.

I think we need to decide where these intrinsics should be 'lowered' if they aren't legal, and define how to let the target specify legality.

Thu, Sep 20, 2:00 AM

Fri, Sep 7

ebevhan added a comment to D51211: [Sema] Emit -Wformat properly for bitfield promotions..

Ping.

Fri, Sep 7, 2:22 AM

Thu, Aug 30

ebevhan added a comment to D51426: [Sema] Prohibit function-scope compound literals with address spaces..

I don't have commit access, so it would be appreciated if someone could commit it.

Thu, Aug 30, 4:53 AM
ebevhan updated the diff for D51426: [Sema] Prohibit function-scope compound literals with address spaces..

Added Embedded-C clause quote.
Fixed formatting.

Thu, Aug 30, 1:41 AM

Wed, Aug 29

ebevhan added inline comments to D51426: [Sema] Prohibit function-scope compound literals with address spaces..
Wed, Aug 29, 11:59 PM
ebevhan created D51426: [Sema] Prohibit function-scope compound literals with address spaces..
Wed, Aug 29, 7:27 AM

Aug 24 2018

ebevhan created D51211: [Sema] Emit -Wformat properly for bitfield promotions..
Aug 24 2018, 4:27 AM

Aug 20 2018

ebevhan added a comment to D50616: [Fixed Point Arithmetic] FixedPointCast.

Would it be simpler instead just to have the logic contained in the virtual function for TargetCodeGenInfo as opposed to returning nullptr since any custom target will end up overriding it anyway and ideally not return nullptr?

I guess that's also possible. I figured it would be clearer to have the generic logic in the more obvious location (CGExprScalar) and fall back to the custom handling if needed. Many of the handlers in TargetCodeGenInfo are empty.

Aug 20 2018, 5:09 AM · Restricted Project

Aug 17 2018

ebevhan added a comment to D50616: [Fixed Point Arithmetic] FixedPointCast.

Sorry I forgot to address this also. Just to make sure I understand this correctly since I haven't used these before: target hooks are essentially for emitting target specific code for some operations right? Does this mean that the EmitFixedPointConversion function should be moved to a virtual method under TargetCodeGenInfo that can be overridden and this is what get's called instead during conversion?

Yes, the thought I had was to have a virtual function in TargetCodeGenInfo that would be called first thing in EmitFixedPointConversion, and if it returns non-null it uses that value instead. It's a bit unfortunate in this instance as the only thing that doesn't work for us is the saturation, but letting you configure *parts* of the emission is a bit too specific.

Aug 17 2018, 12:50 AM · Restricted Project

Aug 16 2018

ebevhan added a comment to D50616: [Fixed Point Arithmetic] FixedPointCast.

I think I've mentioned this before, but I would like to discuss the possibility of adding a target hook(s) for some of these operations (conversions, arithmetic when it comes). Precisely matching the emitted saturation operation is virtually impossible for a target.

Aug 16 2018, 1:43 AM · Restricted Project

Aug 7 2018

ebevhan added a comment to D50278: [Sema] Fix for crash on conditional operation with address_space pointer.

I think the solution to a lot of diagnostic and behavior issues with address spaces is to remove predication on OpenCL. It's a bit odd to have a language feature that is enabled out of the box regardless of langoptions (address spaces) but won't actually work properly unless you're building OpenCL.

Aug 7 2018, 12:33 AM · Restricted Project

Aug 6 2018

ebevhan added inline comments to D49945: [Fixed Point Arithmetic] Fix for FixedPointValueToString.
Aug 6 2018, 4:37 AM · Restricted Project
ebevhan added a comment to D50278: [Sema] Fix for crash on conditional operation with address_space pointer.

When I try the test case on our downstream (and when compiling for our target with an extra flag that enables a bunch of OpenCL-related address space code), I get:

ascrash.c:5:12: error: comparison between ('__attribute__((address_space(1))) char *' and '__attribute__((address_space(2))) char *') which
      are pointers to non-overlapping address spaces
  return x < y ? x : y;
         ~ ^ ~
ascrash.c:5:16: error: conditional operator with the second and third operands of type ('__attribute__((address_space(1))) char *' and
      '__attribute__((address_space(2))) char *') which are pointers to non-overlapping address spaces
  return x < y ? x : y;
               ^ ~   ~

A lot of address space code is hidden behind LangOptions.OpenCL.

Aug 6 2018, 1:39 AM · Restricted Project
ebevhan accepted D49945: [Fixed Point Arithmetic] Fix for FixedPointValueToString.

LGTM.

Aug 6 2018, 1:09 AM · Restricted Project
ebevhan added a comment to D48661: [Fixed Point Arithmetic] Fixed Point Constant.

Sorry for the late response, I've been away.

Aug 6 2018, 1:01 AM · Restricted Project

Jul 4 2018

ebevhan added inline comments to D48661: [Fixed Point Arithmetic] Fixed Point Constant.
Jul 4 2018, 1:32 AM · Restricted Project

Jul 3 2018

ebevhan added inline comments to D48661: [Fixed Point Arithmetic] Fixed Point Constant.
Jul 3 2018, 2:02 AM · Restricted Project

Jun 29 2018

ebevhan added inline comments to D48661: [Fixed Point Arithmetic] Fixed Point Constant.
Jun 29 2018, 7:12 AM · Restricted Project
ebevhan added a comment to D48661: [Fixed Point Arithmetic] Fixed Point Constant.

I also think it would be good with some unit tests for this class once the functionality and interface is nailed down.

Jun 29 2018, 5:00 AM · Restricted Project

Jun 28 2018

ebevhan added inline comments to D48661: [Fixed Point Arithmetic] Fixed Point Constant.
Jun 28 2018, 3:08 AM · Restricted Project

Jun 27 2018

ebevhan added inline comments to D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types.
Jun 27 2018, 1:11 AM · Restricted Project
ebevhan added inline comments to D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types.
Jun 27 2018, 12:27 AM · Restricted Project

Jun 26 2018

ebevhan added inline comments to D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types.
Jun 26 2018, 1:49 AM · Restricted Project
ebevhan added a comment to D46944: [analyzer] Use sufficiently large types for index/size calculation..

Ping.

Jun 26 2018, 1:31 AM

Jun 25 2018

ebevhan added a comment to D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types.

Would it be possible to add some form of target hook (perhaps to CodeGenABIInfo, which is already accessed with getTargetHooks) for fixed-point operations (maybe even some conversions)? As I've mentioned earlier, we emit both IR and intrinsics for many of these operations to make instruction selection possible. I suspect that any target that wants to utilize fixed-point effectively will need this as well.

Jun 25 2018, 5:07 AM · Restricted Project

Jun 20 2018

ebevhan added a comment to D47630: [Sema] Allow creating types with multiple of the same addrspace..

Thanks! I do not have commit access, so it would be great if someone could commit this.

Jun 20 2018, 12:30 AM

Jun 19 2018

ebevhan accepted D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 19 2018, 8:44 AM · Restricted Project
ebevhan added a comment to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.

Just a couple more comments and then I think it looks good.

Jun 19 2018, 7:35 AM · Restricted Project

Jun 18 2018

ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 18 2018, 8:36 AM · Restricted Project

Jun 14 2018

ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 14 2018, 9:37 AM · Restricted Project
ebevhan accepted D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
Jun 14 2018, 6:25 AM · Restricted Project
ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 14 2018, 6:18 AM · Restricted Project

Jun 13 2018

ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 13 2018, 8:20 AM · Restricted Project
ebevhan added inline comments to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
Jun 13 2018, 4:36 AM · Restricted Project
ebevhan accepted D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.

LGTM, but I'm not a code owner so maybe someone else should chime in if they have any input.

Jun 13 2018, 4:34 AM · Restricted Project
ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 13 2018, 1:26 AM · Restricted Project
ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 13 2018, 1:04 AM · Restricted Project

Jun 12 2018

ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 12 2018, 8:57 AM · Restricted Project

Jun 11 2018

ebevhan added a comment to D47627: [ASTContext] Make getAddrSpaceQualType replace address spaces..

Well, the documentation mismatch is worth fixing even if the code isn't. But I think at best your use-case calls for weakening the assertion to be that any existing address space isn't *different*, yeah.

Jun 11 2018, 12:57 AM
ebevhan updated the diff for D47630: [Sema] Allow creating types with multiple of the same addrspace..

Added a warning for identical address spaces.

Jun 11 2018, 12:49 AM

Jun 7 2018

ebevhan added inline comments to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
Jun 7 2018, 8:14 AM · Restricted Project
ebevhan added inline comments to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
Jun 7 2018, 4:52 AM · Restricted Project
ebevhan added a comment to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.

Actually, wait! One last thing I missed.

Jun 7 2018, 2:28 AM · Restricted Project
ebevhan added inline comments to D47630: [Sema] Allow creating types with multiple of the same addrspace..
Jun 7 2018, 2:04 AM
ebevhan added inline comments to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.
Jun 7 2018, 1:39 AM · Restricted Project
ebevhan added a comment to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.

Yes, it looks good to me.

Jun 7 2018, 12:17 AM · Restricted Project

Jun 4 2018

ebevhan added a comment to D47627: [ASTContext] Make getAddrSpaceQualType replace address spaces..

There's actually a bit more to it than in these two patches. The complete diff to this function in our downstream Clang looks like this:

 QualType
 ASTContext::getAddrSpaceQualType(QualType T, unsigned AddressSpace) const {
-  QualType CanT = getCanonicalType(T);
-  if (CanT.getAddressSpace() == AddressSpace)
+  if (T.getLocalQualifiers().getAddressSpace() == AddressSpace)
     return T;
Jun 4 2018, 11:49 PM
ebevhan added a comment to D47627: [ASTContext] Make getAddrSpaceQualType replace address spaces..

I have this patch uploaded as well: https://reviews.llvm.org/D47630

Jun 4 2018, 12:29 AM

Jun 1 2018

ebevhan added inline comments to D47630: [Sema] Allow creating types with multiple of the same addrspace..
Jun 1 2018, 8:09 AM
ebevhan created D47630: [Sema] Allow creating types with multiple of the same addrspace..
Jun 1 2018, 6:18 AM
ebevhan created D47627: [ASTContext] Make getAddrSpaceQualType replace address spaces..
Jun 1 2018, 5:56 AM
ebevhan updated the diff for D46944: [analyzer] Use sufficiently large types for index/size calculation..

Changed ArrayIndexTy back to LongLongTy and reverted the test change.

Jun 1 2018, 2:37 AM
ebevhan added inline comments to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
Jun 1 2018, 12:45 AM · Restricted Project
ebevhan added inline comments to D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type.
Jun 1 2018, 12:22 AM · Restricted Project

May 31 2018

ebevhan added inline comments to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
May 31 2018, 1:00 AM · Restricted Project
ebevhan added inline comments to D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type.
May 31 2018, 12:21 AM · Restricted Project

May 30 2018

ebevhan added a comment to D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type.

Sorry for the late notice; I missed something.

May 30 2018, 7:38 AM · Restricted Project

May 25 2018

ebevhan added inline comments to D46944: [analyzer] Use sufficiently large types for index/size calculation..
May 25 2018, 7:41 AM
ebevhan added a comment to D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type.

With the exception of the two inline comments, this looks good to me now!

May 25 2018, 5:42 AM · Restricted Project

May 24 2018

ebevhan added inline comments to D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type.
May 24 2018, 2:57 PM · Restricted Project
ebevhan added inline comments to D46944: [analyzer] Use sufficiently large types for index/size calculation..
May 24 2018, 12:11 AM

May 23 2018

ebevhan added a comment to D46986: [Fixed Point Arithmetic] Validation Test for Fixed Point Binary Operations and Saturated Addition.

Also, this patch and all of the following 'Validation Test' patches do much more than just add tests, they add plenty of functionality as well. In general, it's quite difficult to tell which patches add what.

May 23 2018, 2:44 AM · Restricted Project
ebevhan added a comment to D46986: [Fixed Point Arithmetic] Validation Test for Fixed Point Binary Operations and Saturated Addition.

I cannot say that I'm pleased with the CodeGen emission of the operations as pure IR. I can only assume that you do not have hardware specifically tailored for these operations, as matching this type of code ought to be quite difficult after optimization is performed.

May 23 2018, 2:40 AM · Restricted Project
ebevhan added inline comments to D46927: [Fixed Point Arithmetic] Augmented Assignment for Fixed Point Types.
May 23 2018, 2:30 AM · Restricted Project
ebevhan added inline comments to D46917: [Fixed Point Arithmetic] Comparison and Unary Operations for Fixed Point Types.
May 23 2018, 2:10 AM · Restricted Project
ebevhan added inline comments to D46917: [Fixed Point Arithmetic] Comparison and Unary Operations for Fixed Point Types.
May 23 2018, 1:41 AM · Restricted Project
ebevhan added a comment to D46915: [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals.

You should not define the fixed-point precision as compiler macros at build configure time. The number of fractional bits (the scaling factor) should be added to TargetInfo as target-configurable variables/accessors, and an accessor should be added to ASTContext (we call it 'getFixedPointScale') to fetch the scaling factor of arbitrary fixed-point types.

May 23 2018, 1:32 AM · Restricted Project
ebevhan added inline comments to D46911: [Fixed Point Arithmetic] Addition of the remaining fixed point types and their saturated equivalents.
May 23 2018, 12:54 AM · Restricted Project
ebevhan added inline comments to D46960: [Fixed Point Arithmetic] Predefined Precision Macros.
May 23 2018, 12:36 AM · Restricted Project
ebevhan added inline comments to D46084: [Fixed Point Arithmetic] Addition of the Fixed Point _Accum type.
May 23 2018, 12:29 AM · Restricted Project

May 21 2018

ebevhan updated the diff for D46944: [analyzer] Use sufficiently large types for index/size calculation..

Made ArrayIndexTy into ssize_t, consolidated the tests and fixed the test that was failing.

May 21 2018, 12:55 AM

May 16 2018

ebevhan added inline comments to D46944: [analyzer] Use sufficiently large types for index/size calculation..
May 16 2018, 10:34 AM
ebevhan added inline comments to D46944: [analyzer] Use sufficiently large types for index/size calculation..
May 16 2018, 8:41 AM
ebevhan created D46944: [analyzer] Use sufficiently large types for index/size calculation..
May 16 2018, 7:34 AM

Apr 24 2018

ebevhan added a comment to D45865: [Sema] Emit -Warray-bounds for multiple levels of subscript expressions..

Thank you! I do not have commit rights, so if someone could commit this that would be great.

Apr 24 2018, 6:05 AM
ebevhan updated the diff for D45865: [Sema] Emit -Warray-bounds for multiple levels of subscript expressions..

Removed local variable and added some more to the test.

Apr 24 2018, 1:21 AM

Apr 20 2018

ebevhan created D45865: [Sema] Emit -Warray-bounds for multiple levels of subscript expressions..
Apr 20 2018, 1:21 AM

Jan 31 2018

ebevhan updated the diff for D42103: [LSR] Don't force bases of foldable formulae to the final type..

Rebased. Another test case was affected, but as far as I can tell, the only difference is the elimination of two bitcasts.

Jan 31 2018, 7:49 AM

Jan 30 2018

ebevhan added a comment to D42103: [LSR] Don't force bases of foldable formulae to the final type..

I replaced the other two instances of Ty with nullptr, and only observed a difference in one AMDGPU test case (preserve-addrspace-assert.ll), likely caused by the change on line 5022. Before, GEPs for double* and i32* were produced, but with the patch, GEPs for the containing struct are produced instead. This is probably because the expander was being forced to emit the pre-offset expressions as the final types (which were double* and i32*) but with the patch it will emit GEPs that take the struct pointer instead.

Jan 30 2018, 6:50 AM

Jan 29 2018

ebevhan added a comment to D42103: [LSR] Don't force bases of foldable formulae to the final type..

Out-of-curiosity do you actually see codegen differences with that patch?

Jan 29 2018, 12:45 AM

Jan 22 2018

ebevhan updated the diff for D42103: [LSR] Don't force bases of foldable formulae to the final type..

Included the complete context. Sorry for missing that!

Jan 22 2018, 12:05 AM

Jan 16 2018

ebevhan created D42103: [LSR] Don't force bases of foldable formulae to the final type..
Jan 16 2018, 7:02 AM