Skip to content

Commit 8d0ec2c

Browse files
authored
[SPIR-V][Doc] Add SPV_INTEL_debug_module spec (#3976)
1 parent 6f17b18 commit 8d0ec2c

File tree

1 file changed

+206
-0
lines changed

1 file changed

+206
-0
lines changed
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
SPV_INTEL_debug_module
2+
======================
3+
4+
Name Strings
5+
------------
6+
7+
SPV_INTEL_debug_module
8+
9+
Contact
10+
-------
11+
12+
To report problems with this extension, please open a new issue at:
13+
14+
https://github.com/intel/llvm
15+
16+
Contributors
17+
------------
18+
19+
- Mariya Podchishchaeva, Intel
20+
- Alexey Sotkin, Intel
21+
- Ashbaugh Ben, Intel
22+
23+
Notice
24+
------
25+
26+
Copyright (c) 2021 Intel Corporation. All rights reserved.
27+
28+
Status
29+
------
30+
31+
First draft
32+
33+
Version
34+
-------
35+
36+
[width="40%",cols="25,25"]
37+
|========================================
38+
| Last Modified Date | 2021-06-22
39+
| Revision | 3
40+
|========================================
41+
42+
Dependencies
43+
------------
44+
45+
This extension is written against the SPIR-V Specification,
46+
Version 1.5 Revision 5, Unified
47+
48+
This extension requires SPIR-V 1.0. and OpenCL.DebugInfo.100 Extended
49+
Instruction Set
50+
51+
Overview
52+
--------
53+
54+
This extension adds new instruction `DebugModuleINTEL` to OpenCL.DebugInfo.100
55+
Extended Instruction Set. This instruction allows to represent concept of a
56+
"module" used in some programming languages.
57+
Example - Fortran module or Clang module. The proposed instruction is defined in
58+
accordance with LLVM `!DIModule` metadata for easier translation between
59+
SPIR-V/LLVM.
60+
61+
Extension Name
62+
--------------
63+
64+
To use this extension within a SPIR-V module, the following
65+
*OpExtension* must be present in the module:
66+
67+
----
68+
OpExtension "SPV_INTEL_debug_module"
69+
----
70+
71+
New Capabilities
72+
----------------
73+
This extension introduces a new capability:
74+
75+
----
76+
DebugInfoModuleINTEL
77+
----
78+
79+
New Instructions
80+
----------------
81+
This extension adds the following extended instruction:
82+
83+
----
84+
DebugModuleINTEL
85+
----
86+
87+
Token Number Assignments
88+
------------------------
89+
[width="45%",cols="30,15"]
90+
|===============================
91+
| DebugInfoModuleINTEL | 6114
92+
| DebugModuleINTEL | 36
93+
|===============================
94+
95+
Modifications to the SPIR-V Specification, Version 1.5, Revision, Unified
96+
--------------------------------------------------------------------------
97+
98+
Capabilities
99+
~~~~~~~~~~~~
100+
101+
Modify Section 3.31, "Capability", adding these rows to the Capability table:
102+
103+
--
104+
[options="header"]
105+
|====
106+
2+^| Capability ^| Implicitly Declares
107+
| 6114 | *DebugInfoModuleINTEL* +
108+
Allow to use `DebugModuleINTEL` extended instruction if OpenCL.DebugInfo.100 Extended Instruction Set is imported |
109+
|====
110+
--
111+
112+
Modifications to the OpenCL.DebugInfo.100 Extended Instruction Set
113+
------------------------------------------------------------------
114+
115+
Instructions
116+
~~~~~~~~~~~
117+
118+
Modify section 4.10 "Imported Entities", adding the following instruction:
119+
120+
[cols="14", width="100%"]
121+
|=====
122+
13+^|*DebugModuleINTEL* +
123+
124+
Represents a module in the programming language, for example a Fortran module. +
125+
126+
_Result Type_ must be *OpTypeVoid* +
127+
128+
_Set_ must be result of an OpExtInstImport instruction. +
129+
130+
_Name_ is an *OpString*, holding the name of the imported module. +
131+
132+
_Source_ is a *DebugSource* instruction representing text of the source program
133+
of the module. +
134+
135+
_Line_ is a single word literal denoting the source line number at which the
136+
declaration or use of a module appears in the _Source_. +
137+
138+
_Parent_ is id of a debug instruction which represents the parent lexical scope. +
139+
140+
_ConfigurationMacros_ is an *OpString*, holding space-separated shell-quoted
141+
list of -D macro definitions as they would appear on a command line specified
142+
to a preprocessor on early stages of _Source_ translation to a SPIR-V module. +
143+
144+
_IncludePath_ is an *OpString*, holding the path to the module map file. +
145+
146+
_APINotesFile_ is an *OpString*, holding the path to an API notes file for this
147+
module. +
148+
149+
_IsDecl_ indicates if the module is a declaration and must be one of the
150+
following values: +
151+
0 indicates that this module is not a declaration +
152+
1 indicates that this module is a declaration +
153+
154+
The *DebugModuleINTEL* instruction has no semantic impact and can be safely
155+
removed from the module if all references to _Result_ of this instruction are
156+
replaced with id of *DebugInfoNone* instruction. +
157+
158+
Result of this instruction can be used as _Entity_ operand of
159+
*DebugImportedEntity* instruction. +
160+
161+
Any non-literal operand, except _Set_, can be _id_ of *DebugInfoNone*
162+
instruction in case the corresponding debug information is unavailable. String
163+
operands can also refer to an *OpString*, holding an empty string in this
164+
case.
165+
166+
| Capability:
167+
*DebugInfoModuleINTEL*
168+
169+
| 13 | 12 | _<id> Result type_ | _Result <id>_ | _<id> Set_ | 36 | _<id> Name_ | _<id> Source_ | _Literal Number Line_ | _<id> Parent_ | _<id> ConfigurationMacros_ | _<id> IncludePath_ | _<id> APINotesFile_ | _Literal IsDeclaration_ |
170+
|=====
171+
172+
Modify the description of *DebugImportedEntity* instruction by changing the
173+
first sentence to:
174+
Represents a C++ namespace using-directive, namespace alias, using-declaration
175+
or imported module.
176+
177+
In section 4.5. Global Variables of OpenCL.DebugInfo.100 Extended
178+
Instruction Set specification:
179+
180+
Modify the description of *DebugGlobalVariable* instruction by changing the
181+
description of _Parent_ operand to:
182+
Parent is a debug instruction which represents parent lexical scope. Must be one
183+
of the following: *DebugCompilationUnit*, *DebugFunction*, *DebugLexicalBlock*,
184+
*DebugTypeComposite* or *DebugModuleINTEL*.
185+
186+
Issues
187+
------
188+
189+
1) Any issues?
190+
191+
Discussion:
192+
193+
...
194+
195+
Revision History
196+
----------------
197+
198+
[cols="5,15,15,70"]
199+
[grid="rows"]
200+
[options="header"]
201+
|========================================
202+
|Rev|Date|Author|Changes
203+
|1|2021-06-04|Mariya Podchishchaeva|Initial revision
204+
|2|2021-06-10|Mariya Podchishchaeva|Apply review Feedback
205+
|3|2021-06-22|Mariya Podchishchaeva|Apply review Feedback
206+
|========================================

0 commit comments

Comments
 (0)