[all-commits] [llvm/llvm-project] c92ec0: [Matrix] Add support for matrix-by-scalar division.

Florian Hahn via All-commits all-commits at lists.llvm.org
Thu Mar 11 14:21:49 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c92ec0dd92babe0519a4ff1c785154cde5696779
      https://github.com/llvm/llvm-project/commit/c92ec0dd92babe0519a4ff1c785154cde5696779
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2021-03-11 (Thu, 11 Mar 2021)

  Changed paths:
    M clang/docs/MatrixTypes.rst
    M clang/include/clang/Basic/Features.def
    M clang/lib/AST/Type.cpp
    M clang/lib/CodeGen/CGExprScalar.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/CodeGen/matrix-type-operators.c
    M clang/test/CodeGen/matrix-type.c
    M clang/test/Sema/matrix-type-operators.c
    M llvm/include/llvm/IR/MatrixBuilder.h

  Log Message:
  -----------
  [Matrix] Add support for matrix-by-scalar division.

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 * (1/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.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D97857




More information about the All-commits mailing list