-
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 17] SPIRVReader: Support OpConstantComposite for coopera…
…tive matrix (#2826) (#2848) 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
49 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
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
; 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 -r -o - %t.spv | llvm-dis | 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: call spir_func target("spirv.CooperativeMatrixKHR", i32, 3, 8, 8, 0) @__spirv_ConstantComposite_RPU3AS142__spirv_CooperativeMatrixKHR__uint_3_8_8_0(i32 42) |