Skip to content

Commit eeefccb

Browse files
MrSidimssys-ce-bb
authored andcommitted
Deprecate SPV_INTEL_token_type (#3025)
Token type will stop being generated by the writer. Yet it still be consumed by the reader. Signed-off-by: Sidorov, Dmitry <[email protected]> Original commit: KhronosGroup/SPIRV-LLVM-Translator@aee0c1fb0ce5a69
1 parent b5c4222 commit eeefccb

File tree

4 files changed

+59
-59
lines changed

4 files changed

+59
-59
lines changed

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -404,16 +404,6 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
404404
if (T->isFloatingPointTy())
405405
return mapType(T, BM->addFloatType(T->getPrimitiveSizeInBits()));
406406

407-
if (T->isTokenTy()) {
408-
BM->getErrorLog().checkError(
409-
BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_token_type),
410-
SPIRVEC_RequiresExtension,
411-
"SPV_INTEL_token_type\n"
412-
"NOTE: LLVM module contains token type, which doesn't have analogs in "
413-
"SPIR-V without extensions");
414-
return mapType(T, BM->addTokenTypeINTEL());
415-
}
416-
417407
// A pointer to image or pipe type in LLVM is translated to a SPIRV
418408
// (non-pointer) image or pipe type.
419409
if (T->isPointerTy()) {
@@ -624,6 +614,14 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
624614
}
625615
}
626616

617+
if (T->isTokenTy()) {
618+
BM->getErrorLog().checkError(
619+
false, SPIRVEC_InvalidModule,
620+
"LLVM module contains token type, which doesn't have a counterpart in "
621+
"SPIR-V");
622+
return nullptr;
623+
}
624+
627625
llvm_unreachable("Not implemented!");
628626
return 0;
629627
}

llvm-spirv/test/extensions/INTEL/SPV_INTEL_token_type/token_type_intel.ll

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
; RUN: llvm-spirv %s -to-binary -o %t.spv
2+
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
3+
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s --check-prefix=CHECK-LLVM
4+
5+
; CHECK-LLVM: declare token @llvm.tokenfoo()
6+
7+
119734787 65536 393230 13 0
8+
2 Capability Addresses
9+
2 Capability Linkage
10+
2 Capability Kernel
11+
2 Capability TokenTypeINTEL
12+
7 Extension "SPV_INTEL_token_type"
13+
5 ExtInstImport 1 "OpenCL.std"
14+
3 MemoryModel 1 2
15+
4 EntryPoint 6 10 "foo"
16+
3 Source 3 102000
17+
6 Name 4 "llvm.tokenfoo"
18+
3 Name 7 "foo"
19+
4 Name 8 "entry"
20+
3 Name 9 "tok"
21+
22+
8 Decorate 4 LinkageAttributes "llvm.tokenfoo" Import
23+
5 Decorate 7 LinkageAttributes "foo" Export
24+
2 TypeTokenINTEL 2
25+
3 TypeFunction 3 2
26+
2 TypeVoid 5
27+
3 TypeFunction 6 5
28+
29+
30+
31+
5 Function 2 4 0 3
32+
33+
1 FunctionEnd
34+
35+
5 Function 5 7 0 6
36+
37+
2 Label 8
38+
4 FunctionCall 2 9 4
39+
1 Return
40+
41+
1 FunctionEnd
42+
43+
5 Function 5 10 0 6
44+
45+
2 Label 11
46+
4 FunctionCall 5 12 7
47+
1 Return
48+
49+
1 FunctionEnd
50+

llvm-spirv/test/negative/feature_requires_extension.ll

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
; Check whether the translator reports an error for a module with token type
2-
; if SPV_INTEL_token_type extension is not used.
32

43
; RUN: llvm-as < %s -o %t.bc
54
; RUN: not llvm-spirv %t.bc 2>&1 --spirv-allow-unknown-intrinsics | FileCheck %s
65

7-
; CHECK: RequiresExtension: Feature requires the following SPIR-V extension:
8-
; CHECK-NEXT: SPV_INTEL_token_type
9-
; CHECK-NEXT: NOTE: LLVM module contains token type, which doesn't have analogs
10-
; CHECK-SAME: in SPIR-V without extensions
6+
; CHECK: InvalidModule: Invalid SPIR-V module: LLVM module contains token type, which doesn't have a counterpart in SPIR-V
117

128
; ModuleID = 'token.bc'
139
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"

0 commit comments

Comments
 (0)