[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-29 Thread Florian Hahn via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6f6e91d19337: [Matrix] Implement + and - operators for MatrixType. (authored by fhahn). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76793/new/

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-29 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clang/lib/Sema/SemaExpr.cpp:12112 +return InvalidOperands(Loc, OriginalLHS, OriginalRHS); + } + fhahn wrote: > rjmccall wrote: >

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-28 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 267061. fhahn marked 7 inline comments as done. fhahn added a comment. Updated tests to use more targeted checks, fix typo and rebased on top of master (so this change can be applied before D76791 . Repository: rG LLVM

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-28 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:12112 +return InvalidOperands(Loc, OriginalLHS, OriginalRHS); + } + rjmccall wrote: > You need to not actually apply this conversion to the LHS if this is a > compound assignment. You

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-28 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Thanks, functionality is looking good for the non-assignment operators. Comment at: clang/lib/Sema/SemaExpr.cpp:12112 +return InvalidOperands(Loc, OriginalLHS, OriginalRHS); + } + You need to not actually apply this conversion to

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-28 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11989 + else +return false; + rjmccall wrote: > fhahn wrote: > > rjmccall wrote: > > > I would suggest checking some preconditions and then just calling > > > `PrepareScalarCast`. > > >

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-28 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 266842. fhahn marked 4 inline comments as done. fhahn added a comment. Use initialization step for all conversions (including for arithemtic types), add & call separate addMatrixBinaryArithmeticOverloads Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-27 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11989 + else +return false; + fhahn wrote: > rjmccall wrote: > > I would suggest checking some preconditions and then just calling > > `PrepareScalarCast`. > > > > You should allow

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-27 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 266675. fhahn added a comment. Fixed overload candidates, use copy instead of const reference, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76793/new/ https://reviews.llvm.org/D76793 Files:

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-27 Thread Florian Hahn via Phabricator via cfe-commits
fhahn marked 2 inline comments as done. fhahn added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:8587 +if (S.Context.hasSameType(M1, M2)) + AddCandidate(M1, M2); + rjmccall wrote: > I don't think this works if one side or the

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-27 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:8587 +if (S.Context.hasSameType(M1, M2)) + AddCandidate(M1, M2); + I don't think this works if one side or the other has e.g. a templated conversion to a matrix type.

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11989 + else +return false; + rjmccall wrote: > I would suggest checking some preconditions and then just calling > `PrepareScalarCast`. > > You should allow implicit conversions from

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-26 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 266303. fhahn marked an inline comment as done. fhahn added a comment. Add support for user-defined conversion function, use PrepareScalarCast and add overloads for matrix +/- operators. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-22 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:11989 + else +return false; + I would suggest checking some preconditions and then just calling `PrepareScalarCast`. You should allow implicit conversions from class types, which

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-18 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. ping :) this patch should be ready to be reviewed independently (it's marked as dependent on D76791 in Phab, but it can be applied independently and changing the relationship in Phab will trigger a bunch of unnecessary emails)

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-05-08 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 262901. fhahn added a comment. Rebase on top of the final version of D72281 . I think this patch is now ready for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76793/new/

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-04-02 Thread Florian Hahn via Phabricator via cfe-commits
fhahn updated this revision to Diff 254598. fhahn added a comment. Implement conversions for matrix/scalar variants. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76793/new/ https://reviews.llvm.org/D76793 Files: clang/include/clang/Sema/Sema.h

[PATCH] D76793: [Matrix] Implement + and - operators for MatrixType.

2020-03-25 Thread Florian Hahn via Phabricator via cfe-commits
fhahn created this revision. fhahn added reviewers: rjmccall, anemet, Bigcheese, rsmith, martong. Herald added subscribers: tschuett, dexonsmith, rnkovacs. Herald added a project: clang. This patch implements the + and - binary operators for values of MatrixType. It adds support for matrix +/-