Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SPIR-V NonSemantic.Shader.DebugInfo.200 #186

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

MrSidims
Copy link
Contributor

@MrSidims MrSidims commented Feb 7, 2023

It's based on NonSemantic.Shader.DebugInfo.100

New functionality compared to NonSemantic.Shader.DebugInfo.100
New instructions: DebugModule, DebugTypeSubrange,
DebugTypeArrayDynamic and DebugTypeString.

New Debug Operations.

DebugTypeArray no longer has an Component Count <id>
operand. It was replaced by a new operand <id>, <id>, ... Subranges to fully represent all characteristics of the
elements of DebugTypeArray.

Added an optional 'Target function' operand to
DebugFunction.

Added a 'SrcLang' table to be used by DebugCompilationUnit
instruction.

Signed-off-by: Sidorov, Dmitry [email protected]

@MrSidims
Copy link
Contributor Author

MrSidims commented Feb 7, 2023

@baldurk hi, may I ask you to take a look? The patch adds new debug instructions, mostly for Fortran and also extends number of debug operations to match DWARF (though some of them require analog of .debug_address and hence are currently just placeholders).

Initially we called the extension as NonSemantic.Kernel.DebugInfo.100 to outline it as debug information for compute and to put less pressure for other vendors to implement it. If you want - this can be restored, but TBH having a single extension looks better.

@baldurk
Copy link
Contributor

baldurk commented Feb 7, 2023

I don't think it's a good idea to make significant revisions to this extinst set after it has been released. Generally speaking that's avoided in vulkan and SPIR-V extensions to my knowledge and I think the ecosystem impact would be hard to predict.

I'd also point you to the original OpenCL.DebugInfo.100 extended instruction set, this one is intended for graphics and graphics shaders, so if you're doing OpenCL work that instruction set (or a new one based on it) is likely a better fit. That extension is also managed by Intel I believe so you might be able to discuss it internally too.

@bashbaug
Copy link
Collaborator

bashbaug commented Feb 8, 2023

We've discussed this internally already and our current thinking is that a) it'd be better to use a non-semantic extended instruction set going forward vs. the original OpenCL.DebugInfo.100 extended instruction set, and b) it'd be nice to have one unified extended instruction set for debug information vs. two different extended instruction sets that are either potentially different or that we'd need to keep in sync.

We're open to suggestions how best to do this. Perhaps we should do a NonSemantic.Shader.DebugInfo.XYZ version instead (for some values of XYZ) so it is clear this is a newer version?

@baldurk
Copy link
Contributor

baldurk commented Feb 8, 2023

In that case yes I think the best thing to do is make a new extended instruction set heavily based on this one, as this one was based on the OpenCL one. Either NonSemantic.Shader.DebugInfo.101 or NonSemantic.Shader.DebugInfo.200, whatever you think is best. Bear in mind though I don't expect the existing users of this set will update to it, so there's still going to be multiple sets in that sense (this version, any new version, and OpenCL.DebugInfo.100).

It's based on NonSemantic.Shader.DebugInfo.100

New functionality compared to NonSemantic.Shader.DebugInfo.100
New instructions: DebugModule, DebugTypeSubrange,
DebugTypeArrayDynamic and DebugTypeString.

New Debug Operations.

DebugTypeArray no longer has an `Component Count <id>`
operand. It was replaced by a new operand `<id>, <id>, ...
Subranges` to fully represent all characteristics of the
elements of DebugTypeArray.

Added an optional 'Target function' operand to
DebugFunction.

Added a 'SrcLang' table to be used by DebugCompilationUnit
instruction.

Signed-off-by: Sidorov, Dmitry <[email protected]>
@MrSidims MrSidims changed the title Update SPIR-V NonSemantic Kernel DebugInfo Instructions Add SPIR-V NonSemantic Kernel DebugInfo Instructions Feb 10, 2023
@MrSidims
Copy link
Contributor Author

Thanks! Based on the feedback restored the original name of the instruction set.

vmaksimo added a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Feb 13, 2023
This patch implements the initial support for the new debug
specification NonSemantic.Kernel.DebugInfo.100.
It also introduces support for the new debug instruction DISubrange.

Spec: KhronosGroup/SPIRV-Registry#186
vmaksimo added a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Feb 13, 2023
This patch implements the initial support for the new debug
specification NonSemantic.Kernel.DebugInfo.100.
It also introduces support for the new debug instruction DISubrange.

Spec: KhronosGroup/SPIRV-Registry#186
@johnkslang johnkslang marked this pull request as draft February 15, 2023 16:40
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Feb 20, 2023
This patch implements the initial support for the new debug specification NonSemantic.Kernel.DebugInfo.100.
It also introduces support for the new debug instruction DISubrange.

Spec: KhronosGroup/SPIRV-Registry#186
MrSidims added a commit to MrSidims/SPIRV-LLVM-Translator that referenced this pull request Feb 22, 2023
It's being added in
KhronosGroup/SPIRV-Registry#186

In DWARF it's used in 'trampoline' functions generated for
external function calls.

Signed-off-by: Sidorov, Dmitry <[email protected]>
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Feb 23, 2023
…it (#1854)

This extended source language table is used by DebugCompilationUnit instruction when the extension is enabled. It enables support for more languages than exists in a core specification.
Spec: KhronosGroup/SPIRV-Registry#186

Enabling of Fortran language also allowed to fix FortranArray test that was originally XFAIL-ed in 9e234d9.
MrSidims added a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Feb 23, 2023
…1853)

It's being added in
KhronosGroup/SPIRV-Registry#186

In DWARF it's used in 'trampoline' functions generated for Fortran external function calls.
@MrSidims MrSidims changed the title Add SPIR-V NonSemantic Kernel DebugInfo Instructions Add SPIR-V NonSemantic.Shader.DebugInfo.200 Feb 24, 2023
@MrSidims MrSidims marked this pull request as ready for review February 24, 2023 12:43
Signed-off-by: Sidorov, Dmitry <[email protected]>
Signed-off-by: Sidorov, Dmitry <[email protected]>
MrSidims added a commit to MrSidims/SPIRV-LLVM-Translator that referenced this pull request Mar 7, 2023
This instruction describes a dynamic array, mostly for Fortran 90.

Unlike DebugTypeArray it has Data Location, Associated, Allocated
and Rank parameters. If the appropriate metadata parameters
appear in LLVM IR in DW_TAG_array_type metadata, then such
debug type becomes treated as dynamic array by the translator
(of course if the appopriate extended instruction set is enabled).

Spec:
KhronosGroup/SPIRV-Registry#186

Signed-off-by: Sidorov, Dmitry <[email protected]>
MrSidims added a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Mar 8, 2023
This instruction describes a dynamic array, mostly for Fortran 90.

Unlike DebugTypeArray it has Data Location, Associated, Allocated
and Rank parameters. If the appropriate metadata parameters
appear in LLVM IR in DW_TAG_array_type metadata, then such
debug type becomes treated as dynamic array by the translator
(of course if the appropriate extended instruction set is enabled).

Spec:
KhronosGroup/SPIRV-Registry#186

Signed-off-by: Sidorov, Dmitry <[email protected]>
vmaksimo added a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Mar 9, 2023
This type instruction describes a string, mostly for Fortran 90.

Spec:
KhronosGroup/SPIRV-Registry#186
vmaksimo added a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Mar 9, 2023
This type instruction describes a string, mostly for Fortran 90.

Spec:
KhronosGroup/SPIRV-Registry#186
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request May 10, 2023
…bugCompilationUnit (KhronosGroup#1854)

This extended source language table is used by DebugCompilationUnit instruction when the extension is enabled. It enables support for more languages than exists in a core specification.
Spec: KhronosGroup/SPIRV-Registry#186

Enabling of Fortran language also allowed to fix FortranArray test that was originally XFAIL-ed in 9e234d9.
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request May 10, 2023
…ronosGroup#1871)

This instruction describes a dynamic array, mostly for Fortran 90.

Unlike DebugTypeArray it has Data Location, Associated, Allocated
and Rank parameters. If the appropriate metadata parameters
appear in LLVM IR in DW_TAG_array_type metadata, then such
debug type becomes treated as dynamic array by the translator
(of course if the appropriate extended instruction set is enabled).

Spec:
KhronosGroup/SPIRV-Registry#186

Signed-off-by: Sidorov, Dmitry <[email protected]>
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request May 10, 2023
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request May 10, 2023
…roup#1878)

This entity represents a module in the programming language, for example a Fortran module.
Spec:
KhronosGroup/SPIRV-Registry#186

The implementation is the same as for SPV_INTEL_debug_module extension. Spec for extension:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_debug_module.asciidoc
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request May 11, 2023
@MrSidims MrSidims marked this pull request as ready for review September 3, 2023 14:42
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
…ronosGroup#1846)

This patch implements the initial support for the new debug specification NonSemantic.Kernel.DebugInfo.100.
It also introduces support for the new debug instruction DISubrange.

Spec: KhronosGroup/SPIRV-Registry#186
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
… DebugFunction (KhronosGroup#1853)

It's being added in
KhronosGroup/SPIRV-Registry#186

In DWARF it's used in 'trampoline' functions generated for Fortran external function calls.
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
…bugCompilationUnit (KhronosGroup#1854)

This extended source language table is used by DebugCompilationUnit instruction when the extension is enabled. It enables support for more languages than exists in a core specification.
Spec: KhronosGroup/SPIRV-Registry#186

Enabling of Fortran language also allowed to fix FortranArray test that was originally XFAIL-ed in 9e234d9.
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
…ronosGroup#1871)

This instruction describes a dynamic array, mostly for Fortran 90.

Unlike DebugTypeArray it has Data Location, Associated, Allocated
and Rank parameters. If the appropriate metadata parameters
appear in LLVM IR in DW_TAG_array_type metadata, then such
debug type becomes treated as dynamic array by the translator
(of course if the appropriate extended instruction set is enabled).

Spec:
KhronosGroup/SPIRV-Registry#186

Signed-off-by: Sidorov, Dmitry <[email protected]>
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
…roup#1878)

This entity represents a module in the programming language, for example a Fortran module.
Spec:
KhronosGroup/SPIRV-Registry#186

The implementation is the same as for SPV_INTEL_debug_module extension. Spec for extension:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_debug_module.asciidoc
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Sep 29, 2023
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Oct 2, 2023
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Oct 2, 2023
mateuszchudyk pushed a commit to mateuszchudyk/SPIRV-LLVM-Translator that referenced this pull request Oct 3, 2023
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
)

This patch implements the initial support for the new debug specification NonSemantic.Kernel.DebugInfo.100.
It also introduces support for the new debug instruction DISubrange.

Spec: KhronosGroup/SPIRV-Registry#186
MrSidims added a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
… DebugFunction (#1853)

It's being added in
KhronosGroup/SPIRV-Registry#186

In DWARF it's used in 'trampoline' functions generated for Fortran external function calls.
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
…bugCompilationUnit (#1854)

This extended source language table is used by DebugCompilationUnit instruction when the extension is enabled. It enables support for more languages than exists in a core specification.
Spec: KhronosGroup/SPIRV-Registry#186

Enabling of Fortran language also allowed to fix FortranArray test that was originally XFAIL-ed in 9e234d9.
MrSidims added a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
)

This instruction describes a dynamic array, mostly for Fortran 90.

Unlike DebugTypeArray it has Data Location, Associated, Allocated
and Rank parameters. If the appropriate metadata parameters
appear in LLVM IR in DW_TAG_array_type metadata, then such
debug type becomes treated as dynamic array by the translator
(of course if the appropriate extended instruction set is enabled).

Spec:
KhronosGroup/SPIRV-Registry#186

Signed-off-by: Sidorov, Dmitry <[email protected]>
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
This type instruction describes a string, mostly for Fortran 90.

Spec:
KhronosGroup/SPIRV-Registry#186
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
This entity represents a module in the programming language, for example a Fortran module.
Spec:
KhronosGroup/SPIRV-Registry#186

The implementation is the same as for SPV_INTEL_debug_module extension. Spec for extension:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_debug_module.asciidoc
MrSidims pushed a commit to KhronosGroup/SPIRV-LLVM-Translator that referenced this pull request Oct 5, 2023
This reverts commit 4cdd415.

Calculation of memory size is done with (element size)*bit_ceil(# elements). 'Memory Size' field is not needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants