1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[LangRef] Fix description of shape args for matrix.multiply.

Currently all code instances within the matrix lowering pass consider
matrix A to be MxN and B to be NxK, producing C which is MxK. Anyone
interacting with this API after reading the docs but without reading the pass
would expect A: MxK, B: KxN, and C: MxN. These changes bring the documentation
in line with the implementation.

One point of concern with this, the original signature as described in the docs
may be better or at least more expected. The interface as it was written
reflected other common matrix multiplication interfaces such as BLAS'[1], where
the matrices are MxK, KxN, MxN respectively. Choosing to honor this requires
changing code and tests instead, but should be mostly just renaming of variables.

Patch by Braedy Kuzma <braedy@ualberta.ca>

[1] http://www.netlib.org/lapack/explore-html/db/dc9/group__single__blas__level3_gafe51bacb54592ff5de056acabd83c260.html#gafe51bacb54592ff5de056acabd83c260

Reviewers: anemet, LuoYuanke, nicolasvasilache, fhahn

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D80663
This commit is contained in:
Braedy Kuzma 2020-06-03 11:23:16 +01:00 committed by Florian Hahn
parent fac721d969
commit 463ba33aa8

View File

@ -15402,21 +15402,23 @@ Syntax:
::
declare vectorty @llvm.matrix.multiply.*(vectorty %A, vectorty %B, i32 <M>, i32 <N>, i32 <K>)
declare vectorty @llvm.matrix.multiply.*(vectorty %A, vectorty %B, i32 <OuterRows>, i32 <Inner>, i32 <OuterColumns>)
Overview:
"""""""""
The '``llvm.matrix.multiply.*``' intrinsic treats %A as matrix with <M> rows and <K> columns, %B as
matrix with <K> rows and <N> columns and multiplies them. The result matrix is returned embedded in the
The '``llvm.matrix.multiply.*``' intrinsic treats %A as a matrix with <OuterRows>
rows and <Inner> columns, %B as a matrix with <Inner> rows and <OuterColumns>
columns and multiplies them. The result matrix is returned embedded in the
result vector.
Arguments:
""""""""""
The <M>, <N> and <K> arguments must be constant integers. The vector argument %A
must have <M> * <K> elements, %B must have <K> * <N> elements and the returned
vector must have <M> * <N> elements.
The <OuterRows>, <Inner> and <OuterColumns> arguments must be constant
integers. The vector argument %A must have <OuterRows> * <Inner> elements, %B
must have <Inner> * <OuterColumns> elements and the returned vector must have
<OuterRows> * <OuterColumns> elements.
'``llvm.matrix.columnwise.load.*``' Intrinsic