[PATCH] D70456: [Matrix] Add first set of matrix intrinsics and initial lowering pass.
Adam Nemet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 20 07:57:40 PST 2019
anemet added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp:157-166
+ MatrixTy getMatrix(Value *MatrixVal, const ShapeInfo &SI,
+ IRBuilder<> Builder) {
+ auto *VType = dyn_cast<VectorType>(MatrixVal->getType());
+ assert(VType && "MatrixVal must be a matrix type");
+ if (auto *C = dyn_cast<Constant>(MatrixVal)) {
+ return splitToColumnVectors(MatrixVal, VType->getElementType(), SI,
+ Builder);
----------------
splitVector and splitToColumnVectors names are not very descriptive especially WRT their difference.
================
Comment at: llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp:243-271
+ /// Return the address of a column vector (\p EltType x \p Rows) at index (\p
+ /// Row, \p Col) of \p Base with original column size of \p Stride elements.
+ Value *computeColumnAddr(Value *Base, unsigned Row, unsigned Col,
+ Value *Stride, Type *EltType, unsigned Rows,
+ IRBuilder<> &Builder) {
+ Value *EltPtr =
+ computeEltAddr(Base, Builder.getInt32(Row), Builder.getInt32(Col),
----------------
Commenting the differences between the overloads would be good, also can these be stand-alone static functions?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70456/new/
https://reviews.llvm.org/D70456
More information about the llvm-commits
mailing list