-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport to 15] SPIRVReader: Support OpConstantComposite for coopera…
…tive matrix (#2826) (#2851) This was hitting a "not implemented UNREACHABLE". Like the other cooperative matrix operations, map this construct to a SPIR-V friendly IR function call. Let `transDbgInfo` skip over `OpConstantComposite` because we're mapping `OpConstantComposite` to an LLVM `Instruction` without having a corresponding `SPIRVInstruction`. (cherry picked from commit 04b5465)
- Loading branch information
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/extensions/KHR/SPV_KHR_cooperative_matrix/constant_composite.spvasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
; REQUIRES: spirv-as | ||
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s | ||
; TODO: re-enable spirv-val | ||
; R/U/N: spirv-val %t.spv | ||
; RUN: llvm-spirv -emit-opaque-pointers -r -o - %t.spv | llvm-dis -opaque-pointers | FileCheck %s | ||
|
||
OpCapability Addresses | ||
OpCapability Kernel | ||
OpCapability CooperativeMatrixKHR | ||
OpExtension "SPV_KHR_cooperative_matrix" | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %1 "testCoopMat" | ||
%void = OpTypeVoid | ||
%uint = OpTypeInt 32 0 | ||
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint | ||
%fnTy = OpTypeFunction %void %_ptr_CrossWorkgroup_uint | ||
%uint_0 = OpConstant %uint 0 | ||
%uint_3 = OpConstant %uint 3 | ||
%uint_8 = OpConstant %uint 8 | ||
%uint_42 = OpConstant %uint 42 | ||
%matTy = OpTypeCooperativeMatrixKHR %uint %uint_3 %uint_8 %uint_8 %uint_0 | ||
%matConst = OpConstantComposite %matTy %uint_42 | ||
%1 = OpFunction %void None %fnTy | ||
%outPtr = OpFunctionParameter %_ptr_CrossWorkgroup_uint | ||
%2 = OpLabel | ||
OpCooperativeMatrixStoreKHR %outPtr %matConst %uint_0 %uint_8 | ||
OpReturn | ||
OpFunctionEnd | ||
|
||
; CHECK-LABEL: @testCoopMat | ||
; CHECK: call spir_func ptr addrspace(1) @__spirv_ConstantComposite_RPU3AS1c(i32 42) |