[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-23 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4362059 , @aaron.ballman wrote: > 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`. I

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4361263 , @jhuber6 wrote: > 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

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4360859 , @jhuber6 wrote: > 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

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4360743 , @jhuber6 wrote: > 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

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D151087#4360606 , @jhuber6 wrote: > In D151087#4360577 , @ebevhan wrote: > >> What would be the semantics of such an operation if the address spaces are >> disjoint? Or, if the

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. 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? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151087/new/

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

2023-05-22 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D58346#4359291 , @jhuber6 wrote: > should C++ really be limited by OpenCL here? It probably shouldn't. There's many places in the codebase where OpenCL flags restrict generic address space behavior. I have a patch at D62574

[PATCH] D130510: Missing tautological compare warnings due to unary operators

2022-09-27 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Hi! A bit of late feedback on this patch. We found a failure in our downstream testing likely originating from here. The failing case is: void f(int a) { (0 != (a | !0LL)); } built with `clang -cc1 -emit-llvm-bc -O2 -v -o foo.bc -x c foo.c`

[PATCH] D62574: Add support for target-configurable address spaces.

2022-07-14 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Sorry for the delay! I rebased the patch onto latest and it mostly worked, with a few hitches. Comment at: clang/lib/Sema/SemaCast.cpp:2617-2619 + (Self.getLangOpts().OpenCL && + (DestPPointee->isFunctionType() || +

[PATCH] D62574: Add support for target-configurable address spaces.

2022-07-14 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 444638. ebevhan added a comment. Herald added a subscriber: steakhal. Rebased and addressed some comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62574/new/ https://reviews.llvm.org/D62574 Files:

[PATCH] D125862: [clang][driver] Add gcc-toolset/devtoolset 12 to prefixes

2022-06-09 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Hi! This test is failing in some of our downstream builds. Comment at: clang/unittests/Driver/ToolChainTest.cpp:647 +std::unique_ptr C( +TheDriver.BuildCompilation({"--gcc-toolchain="})); +ASSERT_TRUE(C); There's a

[PATCH] D62574: Add support for target-configurable address spaces.

2022-06-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. I've been away from LLVM development for a while, and sadly this patch has languished a bit. I don't think there were any strong objections to its inclusion, though. If there is still interest in reviewing this, I could try to rebase the patch (or something resembling

[PATCH] D86447: [AST] Change return type of getTypeInfoInChars to a proper struct instead of std::pair.

2020-10-13 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG101309fe048e: [AST] Change return type of getTypeInfoInChars to a proper struct instead of… (authored by ebevhan). Repository: rG LLVM Github

[PATCH] D86631: [Fixed Point] Add fixed-point to floating point cast types and consteval.

2020-10-13 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9fa7f4845976: [Fixed Point] Add fixed-point to floating point cast types and consteval. (authored by ebevhan). Repository: rG LLVM Github

[PATCH] D88648: Refactor fixed point conversion test.

2020-10-09 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG9c26eb8b915e: Refactor fixed point conversion test. (authored by ebevhan). Repository: rG LLVM Github Monorepo

[PATCH] D88648: Refactor fixed point conversion test.

2020-10-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. Herald added subscribers: cfe-commits, bjope. Herald added a project: clang. ebevhan requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88648 Files: clang/test/Frontend/fixed_point_conversions.c

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

2020-09-29 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan accepted this revision. ebevhan added a comment. This revision is now accepted and ready to land. LGTM, but @aaron.ballman should probably give his two cents as well for completion's sake. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-21 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Ping. Any further comments? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86632/new/ https://reviews.llvm.org/D86632 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 291211. ebevhan added a comment. Fix typo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86632/new/ https://reviews.llvm.org/D86632 Files: clang/lib/CodeGen/CGExprScalar.cpp

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: llvm/include/llvm/IR/FixedPointBuilder.h:126 + /// \p Ty, or a floating point type with a larger exponent than Ty. + Type *getAccommodatingFloatType(Type *Ty, const FixedPointSemantics ) { +const fltSemantics *FloatSema =

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 291203. ebevhan added a comment. Using Type::getFloatingPointTy now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86632/new/ https://reviews.llvm.org/D86632 Files: clang/lib/CodeGen/CGExprScalar.cpp

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-08 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 290502. ebevhan added a comment. Updated method name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86632/new/ https://reviews.llvm.org/D86632 Files: clang/lib/CodeGen/CGExprScalar.cpp

[PATCH] D86631: [Fixed Point] Add fixed-point to floating point cast types and consteval.

2020-09-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 290266. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86631/new/ https://reviews.llvm.org/D86631 Files: clang/include/clang/AST/OperationKinds.def clang/lib/AST/Expr.cpp

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 290267. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86632/new/ https://reviews.llvm.org/D86632 Files: clang/lib/CodeGen/CGExprScalar.cpp

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-09-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 290245. ebevhan added a comment. Added promotion mechanism. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86632/new/ https://reviews.llvm.org/D86632 Files: clang/lib/CodeGen/CGExprScalar.cpp

[PATCH] D86796: [Sema] Address-space sensitive index check for unbounded arrays

2020-09-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:13981 +bool overflow; +llvm::APInt product(index); +product += 1; ebevhan wrote: > chrish_ericsson_atx wrote: > > ebevhan wrote: > > > What if index is wider than

[PATCH] D86796: [Sema] Address-space sensitive index check for unbounded arrays

2020-09-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:14063 + if (isUnboundedArray) { +if (index.isUnsigned() || !index.isNegative()) { + const auto = getASTContext(); This could be early return to avoid the indentation.

[PATCH] D86796: [Sema] Address-space sensitive index check for unbounded arrays

2020-09-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:13981 +bool overflow; +llvm::APInt product(index); +product += 1; What if index is wider than AddrBits, but the active bits are fewer? Then you might miss out on

[PATCH] D62574: Add support for target-configurable address spaces.

2020-09-02 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:10963 +bool +ASTContext::isExplicitAddrSpaceConversionLegal(LangAS From, LangAS To) const { + // If From and To overlap, the cast is legal. ebevhan wrote: > Anastasia wrote: > > Btw I

[PATCH] D62574: Add support for target-configurable address spaces.

2020-09-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D62574#2242471 , @Anastasia wrote: > 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

[PATCH] D86796: [Sema] Address-space sensitive index check for unbounded arrays

2020-09-01 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:13966 if (index.isUnsigned() || !index.isNegative()) { -// It is possible that the type of the base expression after -// IgnoreParenCasts is incomplete, even though the type of the base -//

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-08-27 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: llvm/include/llvm/IR/FixedPointBuilder.h:171-172 +// lossless, except for overflow to infinity which is unlikely. +return B.CreateFMul(Result, +ConstantFP::get(DstTy, std::pow(2, -(int)SrcSema.getScale(; + }

[PATCH] D86632: [Fixed Point] Add codegen for conversion between fixed-point and floating point.

2020-08-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: leonardchan, rjmccall. Herald added subscribers: llvm-commits, cfe-commits, bjope. Herald added projects: clang, LLVM. ebevhan requested review of this revision. The patch adds the required methods to FixedPointBuilder for converting between

[PATCH] D86631: [Fixed Point] Add fixed-point to floating point cast types and consteval.

2020-08-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: leonardchan, rjmccall. Herald added subscribers: bjope, martong. Herald added a project: clang. ebevhan requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D86631 Files:

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

2020-08-24 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan abandoned this revision. ebevhan added a comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82663/new/ https://reviews.llvm.org/D82663 ___ cfe-commits mailing list

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

2020-08-24 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG577f8b157a03: [Fixed Point] Add codegen for fixed-point shifts. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D86282: [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR.

2020-08-24 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG808ac5464521: [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D86447: [AST] Change return type of getTypeInfoInChars to a proper struct instead of std::pair.

2020-08-24 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added a reviewer: efriedma. Herald added subscribers: bjope, martong, jfb. Herald added a project: clang. ebevhan requested review of this revision. Followup to D85191 . This changes getTypeInfoInChars to return a

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

2020-08-21 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 286968. ebevhan added a comment. Revamped patch. It's now based on the FixedPointBuilder. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83294/new/ https://reviews.llvm.org/D83294 Files:

[PATCH] D86282: [Fixed Point] Use FixedPointBuilder to codegen fixed-point IR.

2020-08-20 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: leonardchan, rjmccall. Herald added a subscriber: bjope. Herald added a project: clang. ebevhan requested review of this revision. This changes the methods in CGExprScalar to use FixedPointBuilder to generate IR for fixed-point conversions

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-20 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1e7ec4842c1a: [AST] Get field size in chars rather than bits in RecordLayoutBuilder. (authored by ebevhan). Repository: rG LLVM Github Monorepo

[PATCH] D85312: [ADT] Move FixedPoint.h from Clang to LLVM.

2020-08-20 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1a995a0af3c4: [ADT] Move FixedPoint.h from Clang to LLVM. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-19 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1847 +IsIncompleteArrayType ? CharUnits::Zero() : TI.first; +AlignIsRequired = Context.getTypeInfo(D->getType()).AlignIsRequired; }; efriedma wrote: > Can we fix

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-18 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. It doesn't feel like this patch got a very positive reception, but I'd still like to try a bit more to get it in. Even though it's difficult to test this particular change upstream, would it still be acceptable to take the patch since it reverts the behavior to what it

[PATCH] D85312: [ADT] Move FixedPoint.h from Clang to LLVM.

2020-08-13 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Thanks for reviewing! I'm not really sure who to add as reviewers for D85314 , though, and no one has replied to the RFC on the mailing list yet. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D62574: Add support for target-configurable address spaces.

2020-08-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. I think this works now. It should probably be given a few more reviewers to have a look. Do you have some suggestions, @Anastasia ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62574/new/ https://reviews.llvm.org/D62574

[PATCH] D62574: Add support for target-configurable address spaces.

2020-08-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 284765. ebevhan retitled this revision from "Initial draft of target-configurable address spaces." to "Add support for target-configurable address spaces.". ebevhan edited the summary of this revision. ebevhan added a comment. Rebased and updated summary.

[PATCH] D81904: [clang] Do not crash for unsupported fixed point to floating point conversion

2020-08-11 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd4408fe17f33: [clang] Do not crash for unsupported fixed point to floating point conversion (authored by gousemoodhin, committed by ebevhan). Herald added a project: clang. Herald added a subscriber:

[PATCH] D83325: [Sema] Iteratively strip sugar when removing address spaces.

2020-08-11 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG956582aa1658: [Sema] Iteratively strip sugar when removing address spaces. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83325/new/

[PATCH] D83325: [Sema] Iteratively strip sugar when removing address spaces.

2020-08-11 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D83325#2209589 , @svenvh wrote: > LGTM, but just wondering if the test actually belongs to this patch, as it > doesn't demonstrate the problem without one of your other patches? Mm, that is true, but then I'd be submitting

[PATCH] D83325: [Sema] Iteratively strip sugar when removing address spaces.

2020-08-10 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 284395. ebevhan retitled this revision from "[Sema] Be more thorough when unpacking the AS-qualified pointee for a pointer conversion." to "[Sema] Iteratively strip sugar when removing address spaces.". ebevhan edited the summary of this revision. ebevhan

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

2020-08-07 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGaa0d19a0c8f5: [Fixed Point] Add fixed-point shift operations and consteval. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D85312: [ADT] Move FixedPoint.h from Clang to LLVM.

2020-08-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 283873. ebevhan added a comment. Fix some formatting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85312/new/ https://reviews.llvm.org/D85312 Files: clang/include/clang/AST/APValue.h

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-06 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D85191#2197550 , @bjope wrote: > In D85191#2196863 , @rsmith wrote: > >> In D85191#2195923 , @ebevhan wrote: >> >>> In D85191#2193645

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

2020-08-06 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D62574#2183294 , @Anastasia wrote: > In D62574#2136423 , @ebevhan wrote: > >> It seems that D70605 attempted to >> ameliorate the issues that I

[PATCH] D85312: [ADT] Move FixedPoint.h from Clang to LLVM.

2020-08-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. Herald added subscribers: llvm-commits, cfe-commits, dexonsmith, hiraditya, mgorny. Herald added projects: clang, LLVM. ebevhan requested review of this revision. This patch moves FixedPointSemantics and APFixedPoint from Clang to LLVM ADT. This will make it

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1841 auto setDeclInfo = [&](bool IsIncompleteArrayType) { -TypeInfo TI = Context.getTypeInfo(D->getType()); -FieldAlign = Context.toCharUnitsFromBits(TI.Align); +auto TI =

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-05 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D85191#2193645 , @rsmith wrote: >> This is not ideal, since it makes the calculations char size dependent, and >> breaks for sizes that are not a multiple of the char size. > > How can we have a non-bitfield member whose size

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1841 auto setDeclInfo = [&](bool IsIncompleteArrayType) { -TypeInfo TI = Context.getTypeInfo(D->getType()); -FieldAlign = Context.toCharUnitsFromBits(TI.Align); +auto TI =

[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double

2020-08-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. I submitted a patch with the changes at D85191 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79719/new/ https://reviews.llvm.org/D79719 ___

[PATCH] D85191: [AST] Get field size in chars rather than bits in RecordLayoutBuilder.

2020-08-04 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: jasonliu, efriedma. Herald added a project: clang. Herald added a subscriber: cfe-commits. ebevhan requested review of this revision. In D79719 , LayoutField was refactored to fetch the size of field types

[PATCH] D83325: [Sema] Be more thorough when unpacking the AS-qualified pointee for a pointer conversion.

2020-08-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D83325#2170813 , @rjmccall wrote: > `removeAddrSpaceQualType` should guarantee that it removes the address space > qualifier; you shouldn't need to do something special here. That means it > needs to iteratively desugar and

[PATCH] D79719: [AIX] Implement AIX special alignment rule about double/long double

2020-08-03 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/AST/RecordLayoutBuilder.cpp:1778 -std::pair FieldInfo = - Context.getTypeInfoInChars(D->getType()); -EffectiveFieldSize = FieldSize = FieldInfo.first; It seems that in factoring out this to

[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

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

2020-07-15 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2144551 , @rjmccall wrote: > In D82663#2144219 , @ebevhan wrote: > > > In D82663#2142426 , @rjmccall > > wrote: > > > > > Would it be

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

2020-07-10 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2142426 , @rjmccall wrote: > Would it be sensible to use a technical design more like what the matrix > folks are doing, where LLVM provides a small interface for emitting > operations with various semantics?

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

2020-07-10 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked an inline comment as done. ebevhan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3857 + + // TODO: This misses out on the sanitizer check below. + if (Ops.isFixedPointOp()) leonardchan wrote: > I don't suppose you could

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

2020-07-09 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2140507 , @leonardchan wrote: > In D82663#2130355 , @ebevhan wrote: > > > Well, it's not so much as adding the bit, but adding the information that > > the bit exists. That means

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

2020-07-09 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan marked an inline comment as done. ebevhan added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3603-3604 auto ResultFixedSema = Ctx.getFixedPointSemantics(ResultTy); - auto CommonFixedSema = LHSFixedSema.getCommonSemantics(RHSFixedSema, true); +

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

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 276163. ebevhan added a comment. Rebased. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62574/new/ https://reviews.llvm.org/D62574 Files: clang-tools-extra/clang-tidy/bugprone/VirtualNearMissCheck.cpp

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

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D62574#2136553 , @danilaml wrote: > In D62574#2135662 , @ebevhan wrote: > > > It's generally not safe to alter address spaces below the top level. C is > > just very permissive about

[PATCH] D83325: [Sema] Be more thorough when unpacking the AS-qualified pointee for a pointer conversion.

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: svenvh, rjmccall. Herald added a project: clang. Herald added a subscriber: cfe-commits. When performing a pointer conversion as the second conversion in an SCS where the conversion is a derived-to-base and the address space of the type

[PATCH] D70605: [OpenCL] Fix address space for implicit conversion (PR43145)

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added inline comments. Comment at: clang/lib/Sema/SemaExprCXX.cpp:4106 + NewToType = Context.getAddrSpaceQualType(NewToType, + FromPteeType.getAddressSpace()); + if (ToType->isObjCObjectPointerType())

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

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. It seems that D70605 attempted to ameliorate the issues that I observed (pointer-conversion doing too much), but it didn't manage to solve the problem fully. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62574/new/

[PATCH] D70605: [OpenCL] Fix address space for implicit conversion (PR43145)

2020-07-07 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. I know this is some really late feedback on this patch. I struck upon some issues with while rebasing D62574 . Comment at: clang/lib/Sema/SemaExprCXX.cpp:4106 + NewToType = Context.getAddrSpaceQualType(NewToType,

[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 >

[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] 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

[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

[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

[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

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

2020-06-30 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. Another point is, if we for example have an i16 umul.fix in legalization, we have no way of knowing in the general case that it is safe to replace it with an smul.fix, since the information that the MSB is not significant does not exist on IR level. This is the 'loss

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

2020-06-30 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. In D82663#2117451 , @rjmccall wrote: > Why not legalize to the signed operation? My feeling was that it wasn't right do so in LLVM, because LLVM has no notion of the padding bit and therefore doesn't really care about Clang's

[PATCH] D82662: [CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.

2020-06-29 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfefa34faf551: [CodeGen] Use the common semantic for fixed-point codegen, not the result… (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan updated this revision to Diff 273762. ebevhan added a comment. Fixed some broken CHECK lines. 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

[PATCH] D82662: [CodeGen] Use the common semantic for fixed-point codegen, not the result semantic.

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added a reviewer: leonardchan. Herald added a project: clang. Herald added a subscriber: cfe-commits. Using the result semantic is wrong in some cases, such as unsigned fixed-point + signed integer. In this case, the result semantic is unsigned and the

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added reviewers: leonardchan, rjmccall, bjope. Herald added a project: clang. Herald added a subscriber: cfe-commits. The design of unsigned fixed-point with padding did not really work as originally intended downstream. The issue with the design is that

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG53f5c8b4a14c: [AST] Add fixed-point multiplication constant evaluation. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73186/new/

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG474177c05381: [AST] Improve overflow diagnostics for fixed-point constant evaluation. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGda2f852e1913: [AST] Fix certain consteval assignment and comma operator issues with fixed… (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGeccf7fc7b31a: [AST] Add fixed-point subtraction constant evaluation. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73185/new/

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

2020-06-26 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG94e8ec631dda: [AST] Add fixed-point division constant evaluation. (authored by ebevhan). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D73187/new/

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

2020-06-25 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan added a comment. The last patchset contains the comment about rounding, so I think I will consider this accepted. As a final addendum to the discussion on rounding and overflow... The last Appendix to the E-C TR does actually say: 2. In the first edition requires that overflow

[PATCH] D78294: [Fixed Point] Move the compassign LHS type correction a bit further down. NFCI.

2020-04-17 Thread Bevin Hansson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfd7a34186137: [Fixed Point] Move the compassign LHS type correction a bit further down. NFCI. (authored by ebevhan). Changed prior to commit: https://reviews.llvm.org/D78294?vs=258033=258251#toc

[PATCH] D78294: [Fixed Point] Move the compassign LHS type correction a bit further down. NFCI.

2020-04-16 Thread Bevin Hansson via Phabricator via cfe-commits
ebevhan created this revision. ebevhan added a reviewer: leonardchan. Herald added a project: clang. Herald added a subscriber: cfe-commits. We can simplify the LHSTy correction for fixed-point compassign by moving it below the point where we know we have a compound assignment. Also, we

[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/

[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/

[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

[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] 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

  1   2   3   4   >