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

Contradiction between OpExtInst and debug extension spec #3086

Closed
jaebaek opened this issue Dec 3, 2019 · 0 comments · Fixed by #3104
Closed

Contradiction between OpExtInst and debug extension spec #3086

jaebaek opened this issue Dec 3, 2019 · 0 comments · Fixed by #3104
Assignees

Comments

@jaebaek
Copy link
Contributor

jaebaek commented Dec 3, 2019

OpenCL.100.debug extension (and its old version) says

"DebugScope, DebugNoScope,
DebugDeclare, DebugValue
instructions can interleave with instructions within a function body.
All other debugging instructions should be located between section 9
(All type declarations (OpTypeXXX instructions), all constant instructions, and
all global variable declarations …​) and section 10 (All function declaration)
per the core SPIR-V specification."

However, when I use a debug instruction such as %dbg_src = OpExtInst %void %DbgExt DebugSource %6 %src, it says "ExtInst must be used inside a block", which means OpExtInst is a function scope variable.

In order to avoid this, I think we should update the validation rule for OpExtInst when we use it for debug instructions.

@jaebaek jaebaek self-assigned this Dec 16, 2019
jaebaek added a commit to jaebaek/SPIRV-Tools that referenced this issue Dec 16, 2019
jaebaek added a commit to jaebaek/SPIRV-Tools that referenced this issue Dec 28, 2019
jaebaek added a commit to jaebaek/SPIRV-Tools that referenced this issue Dec 28, 2019
jaebaek added a commit to jaebaek/SPIRV-Tools that referenced this issue Jan 21, 2020
jaebaek added a commit to jaebaek/SPIRV-Tools that referenced this issue Jan 21, 2020
dneto0 pushed a commit that referenced this issue Jan 23, 2020
* Allow OpExtInst for DebugInfo between secion 9 and 10

Fixes #3086

* Handle spirv-opt errors on DebugInfo Ext

* Add IR Loader test

* Fix ir loader bug

* Handle DebugFunction/DebugTypeMember forward reference

* Add test cases (forward reference to function)

* Support old DebugInfo extension

* Validate local debug info out of function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant