forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
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] [SPIR-V 1.2] SPIRVReader: Support LocalSizeHintId (K…
…hronosGroup#2907) (KhronosGroup#2919) If there is no `OpExecutionMode .. LocalSizeHint` in the input, see if there is an `OpExecutionModeId .. LocalSizeHintId` and take the value for the `work_group_size_hint` metadata from the referenced constants instead. Once `LocalSizeHintId` has been translated to LLVM IR, it is indistinguishable from a (non-ID) `LocalSizeHint` execution mode. (cherry picked from commit 420f5dd)
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 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
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,27 @@ | ||
; REQUIRES: spirv-as | ||
|
||
; RUN: spirv-as %s --target-env spv1.2 -o %t.spv | ||
; RUN: spirv-val %t.spv | ||
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv | ||
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s | ||
|
||
OpCapability Addresses | ||
OpCapability Linkage | ||
OpCapability Kernel | ||
OpMemoryModel Physical64 OpenCL | ||
OpEntryPoint Kernel %fn "testLocalSizeHintId" | ||
OpExecutionModeId %fn LocalSizeHintId %uint_64 %uint_1 %uint_1sco | ||
%void = OpTypeVoid | ||
%uint = OpTypeInt 32 0 | ||
%uint_1 = OpConstant %uint 1 | ||
%uint_64 = OpConstant %uint 64 | ||
%uint_1sco = OpSpecConstantOp %uint UDiv %uint_64 %uint_64 | ||
%fnTy = OpTypeFunction %void | ||
|
||
; CHECK: define spir_kernel void @testLocalSizeHintId() {{.*}} !work_group_size_hint ![[MD:[0-9]+]] | ||
; CHECK: ![[MD]] = !{i32 64, i32 1, i32 1} | ||
|
||
%fn = OpFunction %void None %fnTy | ||
%entry = OpLabel | ||
OpReturn | ||
OpFunctionEnd |