[Matrix] Implement + and - operators for MatrixType.
authorFlorian Hahn <flo@fhahn.com>
Fri, 29 May 2020 19:42:22 +0000 (20:42 +0100)
committerFlorian Hahn <flo@fhahn.com>
Fri, 29 May 2020 19:42:22 +0000 (20:42 +0100)
commit6f6e91d19337315548f550479f94cbc0af93c8fe
treeae9774ef6b8b17d47916a1447f4e52c735fcba14
parent1a5c97f3a4b88438b19ff34a285e559e57b1e9d4
[Matrix] Implement + and - operators for MatrixType.

This patch implements the + and - binary operators for values of
MatrixType. It adds support for matrix +/- matrix, scalar +/- matrix and
matrix +/- scalar.

For the matrix, matrix case, the types must initially be structurally
equivalent. For the scalar,matrix variants, the element type of the
matrix must match the scalar type.

Reviewers: rjmccall, anemet, Bigcheese, rsmith, martong

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D76793
clang/include/clang/AST/Type.h
clang/include/clang/Sema/Sema.h
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaOverload.cpp
clang/test/CodeGen/matrix-type-operators.c [new file with mode: 0644]
clang/test/CodeGenCXX/matrix-type-operators.cpp [new file with mode: 0644]
clang/test/Sema/matrix-type-operators.c [new file with mode: 0644]
clang/test/SemaCXX/matrix-type-operators.cpp [new file with mode: 0644]
llvm/include/llvm/IR/MatrixBuilder.h