[llvm] [SPIR-V] Access-chain aggregate pointers to element 0 for cooperative matrix load/store (PR #202050)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 7 01:47:10 PDT 2026


================
@@ -4708,6 +4767,27 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register ResVReg,
       report_fatal_error("incompatible result and operand types in a bitcast");
     return selectOpWithSrcs(ResVReg, ResType, I, {OpReg}, SPIRV::OpBitcast);
   }
+  case Intrinsic::spv_cooperative_matrix_load:
+    // result = OpCooperativeMatrixLoadKHR ptr memory_layout stride
+    return selectOpWithSrcs(ResVReg, ResType, I,
+                            {coopMatrixElementPtr(I.getOperand(2).getReg(), I),
+                             I.getOperand(3).getReg(),
+                             I.getOperand(4).getReg()},
+                            SPIRV::OpCooperativeMatrixLoadKHR);
+  case Intrinsic::spv_cooperative_matrix_store:
+    return selectCoopMatrixStore(I);
+  case Intrinsic::spv_cooperative_matrix_muladd:
+    // result = OpCooperativeMatrixMulAddKHR A B C  (no operands literal: the
+    // signedness mask is for integer matrices; float matmul omits it, valid).
----------------
MrSidims wrote:

remove

https://github.com/llvm/llvm-project/pull/202050


More information about the llvm-commits mailing list