[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: test/Sema/format-strings-bitfield-promotion.c:1 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s + aaron.ballman wrote: > ebevhan wrote: > > ebevhan wrote: > > > aaron.ballman wrote: > > > > aa

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 176571. ebevhan added a comment. Added testing for C++ and different sizes of `int` and `long`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51211/new/ https://reviews.llvm.org/D51211 Files: lib/Sema/SemaChecking.cpp test/Sema/format-strings-b

[PATCH] D53738: [Fixed Point Arithmetic] Fixed Point Addition

2018-12-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:1304 +RHSTy = ResultTy; + } + rjmccall wrote: > leonardchan wrote: > > rjmccall wrote: > > > leonardchan wrote: > > > > rjmccall wrote: > > > > > leonardchan wrote: > > > > > > rjmccall w

[PATCH] D53738: [Fixed Point Arithmetic] Fixed Point Addition

2018-12-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:1304 +RHSTy = ResultTy; + } + rjmccall wrote: > ebevhan wrote: > > rjmccall wrote: > > > leonardchan wrote: > > > > rjmccall wrote: > > > > > leonardchan wrote: > > > > > > rjmccall wrote

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Thanks! I don't have commit access, so I would appreciate it if you could commit the change. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51211/new/ https://reviews.llvm.org/D51211 ___ cfe-commits mailing list cf

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-27 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 188504. ebevhan marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58236/new/ https://reviews.llvm.org/D58236 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaCast.cpp lib/S

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-27 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked an inline comment as done. ebevhan added inline comments. Comment at: test/SemaOpenCL/address-spaces.cl:87 + + // FIXME: This doesn't seem right. This should be an error, not a warning. + __local int * __global * __private * lll; Anastasia wrote:

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-28 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58236#1412267 , @Anastasia wrote: > LGTM! Thanks a lot for fixing this old bug! Btw, do you plan to look at > generalizing this to C++ as well? That does sound like a good idea and I will probably look into it when I have m

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2019-02-28 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Sema/SemaCast.cpp:2309 +auto DestPointeeTypeWithoutAS = Self.Context.removeAddrSpaceQualType( +DestPointeeType.getCanonicalType()); +return Self.Context.hasSameType(SrcPointeeTypeWithoutAS, Anastasia

[PATCH] D58060: Fix diagnostic for addr spaces in reference binding

2019-03-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: test/SemaOpenCLCXX/address-space-references.cl:7 +// can't detect this case and therefore fails. +//int bar(const unsigned int &i); + Is there a reason the declaration is commented out? If it's just a problem with the r

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-03-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Any more input on this? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57464/new/ https://reviews.llvm.org/D57464 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D59105: [RFC] Create an Arbitrary Precision Integer Type.

2019-03-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/AST/ASTContext.cpp:1687-1693 + // toCharUnitsFromBits always rounds down, which isn't a problem when the size + // Width is a multiple of chars, however ArbPrecInt makes this not a valid + // assumption. + return std::make_pair(

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-03-14 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D57464#1425904 , @Anastasia wrote: > I think not. :( But I am wondering if we could proceed for now in some > general direction and then make any improvements later. Probably the biggest > part of this patch is not going to ch

[PATCH] D58236: Make address space conversions a bit stricter.

2019-03-21 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Any more input on this? I could redo the patch to simply fix the bug and not make the conversions stricter, if that's preferable. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58236/new/ https://reviews.llvm.org/D58236 __

[PATCH] D58236: Make address space conversions a bit stricter.

2019-03-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58236#1443082 , @rjmccall wrote: > I think C probably requires us to allow this under an explicit cast, but we > can at least warn about it. It does not require us to allow this as an > implicit conversion, and that should b

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-04-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D57464#1438213 , @Anastasia wrote: > > I think I would lean towards the latter since it means less fudging around > > with a whole bunch of unrelated methods. Do @rjmccall or @rsmith have any > > further opinions on this? > >

[PATCH] D58236: Make address space conversions a bit stricter.

2019-04-15 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Well, it doesn't seem to me like there is consensus on prohibiting nested address space conversion like this. I can simply redo the patch to only include the bugfix on implicit conversions and drop the nesting level checks. CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D58236: Make address space conversions a bit stricter.

2019-04-16 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58236#1467151 , @Anastasia wrote: > In D58236#1466263 , @ebevhan wrote: > > > Well, it doesn't seem to me like there is consensus on prohibiting nested > > address space conversion like

[PATCH] D58236: Make address space conversions a bit stricter.

2019-04-17 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 195520. ebevhan edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58236/new/ https://reviews.llvm.org/D58236 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaCast.cpp li

[PATCH] D58236: Make address space conversions a bit stricter.

2019-05-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. This was accepted a while ago, but never landed. I don't have commit access; could someone commit it? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58236/new/ https://reviews.llvm.org/D58236 ___ cfe-commits mailing

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-09-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Another ping. Anyone up for reviewing this patch? Repository: rC Clang https://reviews.llvm.org/D51211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52286: [Intrinsic] Signed Saturation Intirnsic

2018-09-25 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: include/llvm/CodeGen/ISDOpcodes.h:264 +/// signed value is returned instead. +SSAT, + leonardchan wrote: > ebevhan wrote: > > leonardchan wrote: > > > ebevhan wrote: > > > > With the way the rest is written, it d

[PATCH] D52286: [Intrinsic] Signed Saturation Intirnsic

2018-09-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1119 + case ISD::SSAT: +// Target legalization checked here? +Action = TargetLowering::Expand; leonardchan wrote: > ebevhan wrote: > > leonardchan wrote: > > > ebevhan wr

[PATCH] D57553: [Fixed Point Arithmetic] Check against source value when converting during saturation

2019-02-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. This doesn't seem to address the particular case in the integer conversion patch. In fact, I don't see those conversions at all. Comment at: clang/test/Frontend/fixed_point_add.c:382 + // CHECK-NEXT: [[USE_MIN:%[0-9]+]] = icmp slt i39 [[SUM]], -32768

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-02-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Parse/ParseDeclCXX.cpp:2313 +} + } Anastasia wrote: > ebevhan wrote: > > Anastasia wrote: > > > Anastasia wrote: > > > > ebevhan wrote: > > > > > Is there a reason that the attributes are parsed here and not i

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-02-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: test/SemaCXX/address-space-method-overloading.cpp:28 + //inas4.bar(); + noas.bar(); // expected-error{{call to member function 'bar' is ambiguous}} +} rjmccall wrote: > ebevhan wrote: > > Anastasia wrote: > > > ebevh

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-02-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Parse/ParseDeclCXX.cpp:2313 +} + } Anastasia wrote: > ebevhan wrote: > > Anastasia wrote: > > > ebevhan wrote: > > > > Anastasia wrote: > > > > > Anastasia wrote: > > > > > > ebevhan wrote: > > > > > > > Is th

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-02-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Parse/ParseDeclCXX.cpp:2313 +} + } Anastasia wrote: > ebevhan wrote: > > Anastasia wrote: > > > ebevhan wrote: > > > > Anastasia wrote: > > > > > ebevhan wrote: > > > > > > Anastasia wrote: > > > > > > > Anast

[PATCH] D57464: Generalize method overloading on addr spaces to C++

2019-02-06 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D57464#1386614 , @rjmccall wrote: > Moving parsed attributes between lists isn't unreasonable if that's what you > have to do; we already do that when processing the ObjC ARC qualifiers. The > ambiguity with function attribut

[PATCH] D57553: [Fixed Point Arithmetic] Avoid resizing for types with the same width

2019-02-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D57553#1381920 , @leonardchan wrote: > In regards to solving the problem of resizing for int conversions, I'm > starting to think that we will need that initial resize since if we want to > retain the min-max pattern for all c

[PATCH] D56900: [Fixed Point Arithmetic] Fixed Point and Integer Conversions

2019-02-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/test/Frontend/fixed_point_conversions.c:437 + // DEFAULT-NEXT: [[RES:%[a-z0-9]+]] = trunc i39 [[SATMIN]] to i16 + // DEFAULT-NEXT: store i16 [[RES]], i16* %sat_sa, align 2 + leonardchan wrote: > leonardchan wrote

[PATCH] D57219: [Fixed Point Arithmetic] Fixed Point Comparisons

2019-02-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3444 case BO_NE: +return Builder.CreateICmpNE(FullLHS, FullRHS); + case BO_Mul: rjmccall wrote: > leonardchan wrote: > > rjmccall wrote: > > > Are padding bits guaranteed zero o

[PATCH] D57219: [Fixed Point Arithmetic] Fixed Point Comparisons

2019-02-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3444 case BO_NE: +return Builder.CreateICmpNE(FullLHS, FullRHS); + case BO_Mul: ebevhan wrote: > rjmccall wrote: > > leonardchan wrote: > > > ebevhan wrote: > > > > rjmccall wro

[PATCH] D58060: Fix diagnostic for addr spaces in static_cast

2019-02-13 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. So static_cast permits conversions from AS1 to AS2 where that conversion is implicitly allowed, and the new addrspace_cast would permit conversions from AS1 to AS2 where it is explicitly allowed. That seems like it fits in rather well with the idea in D57464

[PATCH] D58060: Fix diagnostic for addr spaces in static_cast

2019-02-13 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58060#1396565 , @Anastasia wrote: > We had discussion related to this with John earlier. And I documented it in > this bug: https://bugs.llvm.org/show_bug.cgi?id=39674 I think we observed something similar to this downstream

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-14 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: Anastasia, rjmccall. Herald added subscribers: cfe-commits, jdoerfert. Herald added a project: clang. The semantics for converting nested pointers between address spaces are not very well defined. Some conversions which do not really carry an

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-14 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked an inline comment as done. ebevhan added inline comments. Comment at: test/SemaOpenCL/address-spaces.cl:89 + __local int * __global * __private * lll; + lll = gg; // expected-warning {{incompatible pointer types assigning to '__local int *__global **' from '__gl

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 187230. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58236/new/ https://reviews.llvm.org/D58236 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaCast.cpp lib/Sema/SemaExpr.cpp test/CodeGenOpenCL/numbered-address-space.cl test

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked 6 inline comments as done. ebevhan added inline comments. Comment at: lib/Sema/SemaCast.cpp:2295 + // FIXME: C++ might want to emit different errors here. if (Self.getLangOpts().OpenCL) { +const Type *DestPtr, *SrcPtr; I'd also like to peti

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2019-02-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Sema/SemaCast.cpp:2224 + } else if (IsLValueCast) { Kind = CK_LValueBitCast; } else if (DestType->isObjCObjectPointerType()) { This might not be applicable to this patch, but just something I noticed. So `r

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked 5 inline comments as done. ebevhan added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6996 + "|%diff{casting $ to type $|casting between types}0,1}2" + " changes address space of nested pointer">; def err_typecheck_incompatible_ownersh

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked an inline comment as done. ebevhan added inline comments. Comment at: test/SemaOpenCL/address-spaces.cl:89 + __local int * __global * __private * lll; + lll = gg; // expected-warning {{incompatible pointer types assigning to '__local int *__global **' from '__gl

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2019-02-19 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Sema/SemaCast.cpp:2224 + } else if (IsLValueCast) { Kind = CK_LValueBitCast; } else if (DestType->isObjCObjectPointerType()) { Anastasia wrote: > ebevhan wrote: > > This might not be applicable to this patch

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 187531. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58236/new/ https://reviews.llvm.org/D58236 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/Sema.h lib/Sema/SemaCast.cpp lib/Sema/SemaExpr.cpp test/CodeGenOpenCL/numb

[PATCH] D58236: Make address space conversions a bit stricter.

2019-02-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked 2 inline comments as done. ebevhan added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6996 + "|%diff{casting $ to type $|casting between types}0,1}2" + " changes address space of nested pointer">; def err_typecheck_incompatible_ownersh

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2019-02-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Sema/SemaCast.cpp:2224 + } else if (IsLValueCast) { Kind = CK_LValueBitCast; } else if (DestType->isObjCObjectPointerType()) { Anastasia wrote: > ebevhan wrote: > > Anastasia wrote: > > > ebevhan wrote: > >

[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

2019-02-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Sema/SemaCast.cpp:2224 + } else if (IsLValueCast) { Kind = CK_LValueBitCast; } else if (DestType->isObjCObjectPointerType()) { Anastasia wrote: > ebevhan wrote: > > Anastasia wrote: > > > Anastasia wrote: >

[PATCH] D37254: [Sema] Disallow assigning record lvalues with nested const-qualified fields.

2017-08-29 Thread Bevin Hansson via Phabricator via cfe-commits
bevinh created this revision. According to C99 6.3.2.1p1, structs and unions with nested const-qualified fields (that is, const-qualified fields declared at some recursive level of the aggregate) are not modifiable lvalues. However, Clang permits assignments of these lvalues. With this patch, we

[PATCH] D37254: [Sema] Disallow assigning record lvalues with nested const-qualified fields.

2017-09-08 Thread Bevin Hansson via Phabricator via cfe-commits
bevinh updated this revision to Diff 114340. bevinh marked an inline comment as done. bevinh added a comment. Added a diag note for NestedConstMember. https://reviews.llvm.org/D37254 Files: include/clang/AST/Expr.h include/clang/AST/Type.h include/clang/Basic/DiagnosticSemaKinds.td lib/

[PATCH] D62574: Initial draft of target-configurable address spaces.

2019-06-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D62574#1523835 , @Anastasia wrote: > > This patch does not address the issue with the accessors > > on Qualifiers (isAddressSpaceSupersetOf, compatiblyIncludes), > > because I don't know how to solve it without breaking a ton

[PATCH] D62574: Initial draft of target-configurable address spaces.

2019-06-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. >> I'll have to see if that's possible without breaking a few more interfaces, >> since you can throw around Qualifiers and check for compatibility without an >> ASTContext today. >> >>> I was just thinking about testing the new logic. Should we add something >>> like

[PATCH] D62574: Initial draft of target-configurable address spaces.

2019-06-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 203559. ebevhan added a comment. Replaced `compatiblyIncludes` and its dependents with ASTContext accessors instead. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62574/new/ https://reviews.llvm.org/D62574 Files: include/clang/AST/ASTContext.h

[PATCH] D62574: Initial draft of target-configurable address spaces.

2019-07-29 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked 4 inline comments as done. ebevhan added a comment. Sorry for the very late response to this! Comment at: include/clang/AST/ASTContext.h:2598 + /// Returns true if address space A overlaps with B. + bool isAddressSpaceOverlapping(LangAS A, LangAS B) const { +

[PATCH] D66206: [CodeGen] Don't keep stale pointers to LoopInfos

2019-08-14 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added a reviewer: aaron.ballman. Herald added a project: clang. Herald added a subscriber: cfe-commits. CGLoopInfo was keeping pointers to parent loop LoopInfos, but when the loop info vector grew, it reallocated the storage and invalidated all of the parent

[PATCH] D66206: [CodeGen] Don't keep stale pointers to LoopInfos

2019-08-19 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Thanks! I don't have commit access, so it would be great if you could commit this for me. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66206/new/ https://reviews.llvm.org/D66206 ___ cfe-co

[PATCH] D62574: Initial draft of target-configurable address spaces.

2019-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked 3 inline comments as done. ebevhan added a comment. In D62574#1552220 , @Anastasia wrote: > Ok, I think at some point you might want to test extra functionality that > doesn't fit into OpenCL model, for example explicit conversion over > n

[PATCH] D62574: Initial draft of target-configurable address spaces.

2019-05-29 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: Anastasia, rjmccall. Herald added a project: clang. Herald added a subscriber: cfe-commits. This is an initial draft of the support for target-configurable address spaces. Original RFC: http://lists.llvm.org/pipermail/cfe-dev/2019-March/0615

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-12 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Hmm, sorry about that. I'll have a look. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51211/new/ https://reviews.llvm.org/D51211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-12 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 177831. ebevhan added a comment. Fix the build failures (caused by default argument promotion of float vectors). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51211/new/ https://reviews.llvm.org/D51211 Files: lib/Sema/SemaChecking.cpp test/Sema

[PATCH] D54862: [OpenCL] Add generic AS to 'this' pointer

2018-12-17 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/CodeGen/CGCall.cpp:77 + if (MD) +RecTy = Context.getAddrSpaceQualType(RecTy, MD->getType().getAddressSpace()); return Context.getPointerType(CanQualType::CreateUnsafe(RecTy)); I'm a bit late to the party, bu

[PATCH] D54862: [OpenCL] Add generic AS to 'this' pointer

2018-12-17 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. I'm also a bit confused about the semantics that this patch is applying to function types. It mostly seems to concern the extra trailing Qualifiers on CXXMethodDecl to store the addrspace quals, but in some places (SemaType:4842, SemaDecl:3198) it seems to be applying t

[PATCH] D55656: [OpenCL] Address space for default class members

2018-12-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/AST/ASTContext.cpp:2781 + + return getAddrSpaceQualType(NewT, Orig.getAddressSpace()); } rjmccall wrote: > Anastasia wrote: > > rjmccall wrote: > > > You're trying to handle a method qualifier, not a type a functio

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked an inline comment as done. ebevhan added inline comments. Comment at: lib/Sema/SemaChecking.cpp:7725-7726 +return true; + // Look through vector types, since we do default argument promotion for + // those in OpenCL. + if (const ExtVectorType *VecTy = From->

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 178605. ebevhan added a comment. Use `auto`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51211/new/ https://reviews.llvm.org/D51211 Files: lib/Sema/SemaChecking.cpp test/Sema/format-strings-bitfield-promotion.c test/Sema/format-strings-bitf

[PATCH] D51211: [Sema] Emit -Wformat properly for bitfield promotions.

2018-12-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Thanks, that would be great! Hopefully it will work this time. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D51211/new/ https://reviews.llvm.org/D51211 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D55868: [Fixed Point Arithmetic] Fixed Point Addition Constant Expression Evaluation

2018-12-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/include/clang/Basic/FixedPoint.h:98 public: + APFixedPoint() = default; APFixedPoint(const llvm::APInt &Val, const FixedPointSemantics &Sema) rjmccall wrote: > This should be documented to describe what it

[PATCH] D56066: [OpenCL] Address space for default class members

2019-01-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Sema/SemaInit.cpp:4539 + if (InitCategory.isPRValue() || InitCategory.isXValue()) +T1Quals.removeAddressSpace(); + rjmccall wrote: > rjmccall wrote: > > I can understand why a pr-value wouldn't have an address s

[PATCH] D45865: [Sema] Emit -Warray-bounds for multiple levels of subscript expressions.

2018-04-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: danielmarjamaki, aaron.ballman. Herald added a subscriber: cfe-commits. This patch has CheckArrayBounds recurse into ArraySubscriptExprs and MemberExprs, giving warnings for invalid indices for every level of subscript instead of just the top

[PATCH] D45865: [Sema] Emit -Warray-bounds for multiple levels of subscript expressions.

2018-04-24 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 143684. ebevhan added a comment. Removed local variable and added some more to the test. https://reviews.llvm.org/D45865 Files: lib/Sema/SemaChecking.cpp test/SemaCXX/array-bounds.cpp test/SemaCXX/constant-expression-cxx11.cpp Index: test/SemaCXX/co

[PATCH] D45865: [Sema] Emit -Warray-bounds for multiple levels of subscript expressions.

2018-04-24 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Thank you! I do not have commit rights, so if someone could commit this that would be great. https://reviews.llvm.org/D45865 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-25 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. 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 operat

[PATCH] D46944: [analyzer] Use sufficiently large types for index/size calculation.

2018-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Herald added a subscriber: mikhail.ramalho. Ping. https://reviews.llvm.org/D46944 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/AST/ExprConstant.cpp:9501 + return false; +return Success(Result.getInt() >> Scale, E); + } ebevhan wrote: > The shift here will not produce the correct rounding behavior for fixed-point > to integer conve

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-27 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: include/clang/AST/ASTContext.h:1954 + llvm::APInt getFixedPointMin(QualType Ty) const; + llvm::APInt getFixedPointOne(QualType Ty) const; rjmccall wrote: > ebevhan wrote: > > rjmccall wrote: > > > Are these opaque bi

[PATCH] D48456: [Fixed Point Arithmetic] Casting between fixed point types and other arithmetic types

2018-06-27 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/CodeGen/CGExprScalar.cpp:768 +if (CGF.getContext().getTargetInfo().unsignedFixedPointTypesHavePadding() && +Ty->isUnsignedFixedPointType()) { + unsigned NumBits = CGF.getContext().getTypeSize(Ty); r

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-06-28 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: include/clang/Basic/FixedPoint.h:23 + +class FixedPointNumber { + public: rjmccall wrote: > The established naming convention here — as seen in `APInt`, `APFloat`, > `APValue`, etc. — would call this `APFixedPoint`. Ma

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-06-29 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. I also think it would be good with some unit tests for this class once the functionality and interface is nailed down. Comment at: include/clang/Basic/FixedPoint.h:31 + SatNoPadding, +}; + rjmccall wrote: > I figured you'd want this t

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-06-29 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Basic/FixedPoint.cpp:53 +// We can overflow here +unsigned ShiftAmt = DstScale - Scale; +if (Val < 0 && Val.countLeadingOnes() >= ShiftAmt) ebevhan wrote: > I think saturation can be modeled a bit better.

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-07-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: include/clang/Basic/FixedPoint.h:67 + // Convert this number to match the semantics provided. + void convert(const struct fixedPointSemantics &DstSema); + If this class is supposed to be used like APInt and APSInt, per

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-07-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: lib/Basic/FixedPoint.cpp:40 + if (DstWidth > Val.getBitWidth()) +Val = Val.extend(DstWidth); + if (Upscaling) leonardchan wrote: > ebevhan wrote: > > It should be possible to replace this with `extOrTrunc` and move

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-16 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2153834 , @rjmccall wrote: > I don't understand. The problem statement as I understood it is that using > unsigned intrinsics to do unsigned-with-padding operations is leading to poor > code-gen, so you want to start u

[PATCH] D73182: [CodeGen] Emit IR for fixed-point multiplication and division.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255970. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73182/new/ https://reviews.llvm.org/D73182 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/test/Frontend/fixed_point_

[PATCH] D73183: [CodeGen] Emit IR for fixed-point unary operators.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255971. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73183/new/ https://reviews.llvm.org/D73183 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/test/Frontend/fixed_point_

[PATCH] D73186: [AST] Add fixed-point multiplication constant evaluation.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255976. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73186/new/ https://reviews.llvm.org/D73186 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprConstant.c

[PATCH] D73184: [CodeGen] Emit IR for compound assignment with fixed-point operands.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255972. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73184/new/ https://reviews.llvm.org/D73184 Files: clang/lib/CodeGen/CGExprScalar.cpp clang/lib/Sema/SemaExpr.cpp cl

[PATCH] D73257: [AST] Compress the FixedPointSemantics type better.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255974. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73257/new/ https://reviews.llvm.org/D73257 Files: clang/include/clang/Basic/FixedPoint.h Index: clang/include/clang/B

[PATCH] D73185: [AST] Add fixed-point subtraction constant evaluation.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255975. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73185/new/ https://reviews.llvm.org/D73185 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprConstant.c

[PATCH] D73187: [AST] Add fixed-point division constant evaluation.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255977. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73187/new/ https://reviews.llvm.org/D73187 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprConstant.c

[PATCH] D73188: [AST] Improve overflow diagnostics for fixed-point constant evaluation.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255978. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73188/new/ https://reviews.llvm.org/D73188 Files: clang/include/clang/Basic/DiagnosticASTKinds.td clang/lib/AST/ExprC

[PATCH] D73189: [AST] Fix certain consteval assignment and comma operator issues with fixed-point types.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 255979. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73189/new/ https://reviews.llvm.org/D73189 Files: clang/lib/AST/ExprConstant.cpp clang/test/Frontend/fixed_point_cras

[PATCH] D73184: [CodeGen] Emit IR for compound assignment with fixed-point operands.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG313461f6d8f9: [CodeGen] Emit IR for compound assignment with fixed-point operands. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73184

[PATCH] D73182: [CodeGen] Emit IR for fixed-point multiplication and division.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0b9922e67a0b: [CodeGen] Emit IR for fixed-point multiplication and division. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73182/new/

[PATCH] D73257: [AST] Compress the FixedPointSemantics type better.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd5d0d8eb7d09: [AST] Compress the FixedPointSemantics type better. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73257/new/ https://re

[PATCH] D73183: [CodeGen] Emit IR for fixed-point unary operators.

2020-04-08 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG39baaabf6de4: [CodeGen] Emit IR for fixed-point unary operators. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73183/new/ https://rev

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Well, it's not so much as adding the bit, but adding the information that the bit exists. That means either new intrinsics for all of the operations, or adding flags to the existing ones. That's a fair bit of added complexity. Also, + would do virtually the exact same

[PATCH] D82663: [CodeGen] Have CodeGen for fixed-point unsigned with padding emit signed operations.

2020-07-06 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 275657. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82663/new/ https://reviews.llvm.org/D82663 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/Basic/FixedPoint.c

[PATCH] D83212: [Fixed Point] Add fixed-point shift operations and consteval.

2020-07-06 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: rjmccall, leonardchan, bjope. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83212 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprC

[PATCH] D83212: [Fixed Point] Add fixed-point shift operations and consteval.

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 275962. ebevhan added a comment. Fix test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83212/new/ https://reviews.llvm.org/D83212 Files: clang/include/clang/Basic/FixedPoint.h clang/lib/AST/ExprConstant.

[PATCH] D83294: [Fixed Point] Add codegen for fixed-point shifts.

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: rjmccall, leonardchan, bjope. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch adds codegen to Clang for fixed-point shift operations. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D83294

[PATCH] D62574: Initial draft of target-configurable address spaces.

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a subscriber: danilaml. ebevhan added a comment. In D62574#2133160 , @danilaml wrote: > What are the remaining roadblocks left before this patch can be merged? I'm > interested in having a target-specific way to define the allowed > explici

<    1   2   3   4   >