[clang] [lldb] [llvm] [OpenCL][Clang] Add support for cooperative matrix extension (PR #221328)

via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 17:56:22 PST 2026


================
@@ -0,0 +1,51 @@
+; RUN: llc -mtriple=spirv64-unknown-unknown \
+; RUN:   -spirv-ext=+SPV_KHR_cooperative_matrix \
+; RUN:   -filetype=asm < %s | FileCheck %s
+
+target triple = "spirv64-unknown-unknown"
+
+%coopmat.f32.sc3.16x16.u0 =
+    type target("spirv.CooperativeMatrixKHR", float, 3, 16, 16, 0)
+
+; ---------------------------------------------------------------------------
+; Suffix branch.
+; ---------------------------------------------------------------------------
+
+declare spir_func %coopmat.f32.sc3.16x16.u0
+ at __spirv_CooperativeMatrixLoadKHR_f32_sc3_16x16_u0_global(
+    ptr addrspace(1), i32)
+
+define spir_kernel void @test_mangled_load(
+    ptr addrspace(1) %ptr) {
+entry:
+  %mat = call spir_func %coopmat.f32.sc3.16x16.u0
+      @__spirv_CooperativeMatrixLoadKHR_f32_sc3_16x16_u0_global(
+          ptr addrspace(1) %ptr, i32 16)
----------------
asudarsa-qti wrote:

I made some initial changes to SPIR-V backend to correctly lower load operations. IIUC, there are few other changes required in SPIR-V backend to fully support coop matrix operations. That is beyond the scope of this PR.

Thanks

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


More information about the cfe-commits mailing list