[PATCH] D131125: [Matrix] Add special case dot product lowering

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 11 12:02:07 PDT 2022


thegameg accepted this revision.
thegameg added a comment.
This revision is now accepted and ready to land.

LGTM, thank you!



================
Comment at: llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp:1236
+    Function *Add = Intrinsic::getDeclaration(Func.getParent(), AddOpCode,
+                                    ElementType);
+
----------------
Not sure what's going on here. Intrinsic with `Instruction::Add`? It also doesn't seem to be really used.


================
Comment at: llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp:1252
+    auto GetBuiltinLoad = [](Value *Val) -> CallInst * {
+      if (match(Val, m_Intrinsic<Intrinsic::matrix_column_major_load>())) {
+        return cast<CallInst>(Val);
----------------
You cold match the stride directly here:

```
ConstantInt *LoadStride = nullptr;
if (match(Val, m_Intrinsic<Intrinsic::matrix_column_major_load>(
                       m_Value(), m_ConstantInt(LoadStride), m_Value(), m_Value()) &&
    LoadStride->getZExtValue() == Stride) {
```

and pass `Stride` as an argument of `GetBuiltinLoad`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131125/new/

https://reviews.llvm.org/D131125



More information about the llvm-commits mailing list