File tree Expand file tree Collapse file tree 4 files changed +59
-59
lines changed
extensions/INTEL/SPV_INTEL_token_type Expand file tree Collapse file tree 4 files changed +59
-59
lines changed Original file line number Diff line number Diff line change @@ -400,16 +400,6 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
400
400
if (T->isFloatingPointTy ())
401
401
return mapType (T, BM->addFloatType (T->getPrimitiveSizeInBits ()));
402
402
403
- if (T->isTokenTy ()) {
404
- BM->getErrorLog ().checkError (
405
- BM->isAllowedToUseExtension (ExtensionID::SPV_INTEL_token_type),
406
- SPIRVEC_RequiresExtension,
407
- " SPV_INTEL_token_type\n "
408
- " NOTE: LLVM module contains token type, which doesn't have analogs in "
409
- " SPIR-V without extensions" );
410
- return mapType (T, BM->addTokenTypeINTEL ());
411
- }
412
-
413
403
// A pointer to image or pipe type in LLVM is translated to a SPIRV
414
404
// (non-pointer) image or pipe type.
415
405
if (T->isPointerTy ()) {
@@ -620,6 +610,14 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
620
610
}
621
611
}
622
612
613
+ if (T->isTokenTy ()) {
614
+ BM->getErrorLog ().checkError (
615
+ false , SPIRVEC_InvalidModule,
616
+ " LLVM module contains token type, which doesn't have a counterpart in "
617
+ " SPIR-V" );
618
+ return nullptr ;
619
+ }
620
+
623
621
llvm_unreachable (" Not implemented!" );
624
622
return 0 ;
625
623
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change 1
1
; Check whether the translator reports an error for a module with token type
2
- ; if SPV_INTEL_token_type extension is not used.
3
2
4
3
; RUN: llvm-as < %s -o %t.bc
5
4
; RUN: not llvm-spirv %t.bc 2>&1 --spirv-allow-unknown-intrinsics | FileCheck %s
6
5
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
11
7
12
8
; ModuleID = 'token.bc'
13
9
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"
You can’t perform that action at this time.
0 commit comments