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 @@ -325,16 +325,6 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
325
325
if (T->isFloatingPointTy ())
326
326
return mapType (T, BM->addFloatType (T->getPrimitiveSizeInBits ()));
327
327
328
- if (T->isTokenTy ()) {
329
- BM->getErrorLog ().checkError (
330
- BM->isAllowedToUseExtension (ExtensionID::SPV_INTEL_token_type),
331
- SPIRVEC_RequiresExtension,
332
- " SPV_INTEL_token_type\n "
333
- " NOTE: LLVM module contains token type, which doesn't have analogs in "
334
- " SPIR-V without extensions" );
335
- return mapType (T, BM->addTokenTypeINTEL ());
336
- }
337
-
338
328
// A pointer to image or pipe type in LLVM is translated to a SPIRV
339
329
// (non-pointer) image or pipe type.
340
330
if (T->isPointerTy ()) {
@@ -550,6 +540,14 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
550
540
}
551
541
}
552
542
543
+ if (T->isTokenTy ()) {
544
+ BM->getErrorLog ().checkError (
545
+ false , SPIRVEC_InvalidModule,
546
+ " LLVM module contains token type, which doesn't have a counterpart in "
547
+ " SPIR-V" );
548
+ return nullptr ;
549
+ }
550
+
553
551
llvm_unreachable (" Not implemented!" );
554
552
return 0 ;
555
553
}
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