[PATCH] D97857: [Matrix] Add support for matrix-by-scalar division.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 07:05:32 PST 2021


fhahn created this revision.
fhahn added reviewers: anemet, rjmccall, rsmith, Bigcheese.
Herald added subscribers: dexonsmith, tschuett.
fhahn requested review of this revision.
Herald added projects: clang, LLVM.
Herald added a subscriber: llvm-commits.

This patch extends the matrix spec to allow matrix-by-scalar division.

Originally support for `/` was left out to avoid ambiguity for the
matrix-matrix version of `/`, which could either be elementwise or
specified as matrix multiplication M1 <https://reviews.llvm.org/M1> * (1/M2 <https://reviews.llvm.org/M2>).

For the matrix-scalar version, no ambiguity exists; `*` is also
an elementwise operation in that case. Matrix-by-scalar division
is commonly supported by systems including Matlab, Mathematica
or NumPy.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97857

Files:
  clang/docs/MatrixTypes.rst
  clang/lib/AST/Type.cpp
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/test/CodeGen/matrix-type-operators.c
  clang/test/Sema/matrix-type-operators.c
  llvm/include/llvm/IR/MatrixBuilder.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97857.327781.patch
Type: text/x-patch
Size: 13244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210303/f6c70c1e/attachment.bin>


More information about the llvm-commits mailing list