Skip to content

[SPIR-V] debug info omits scope necessary for for-loops #8514

@SteveUrquhart

Description

@SteveUrquhart

Description
When outputting NS100 debug info, SpirvEmitter currently skips a lexical scope that coincides with the '(' and ')' of the for loop. This leads to confusing debug info.

Steps to Reproduce
https://godbolt.org/z/Pfe5zcPTb

Actual Behavior
%65 = OpExtInst %void %1 DebugLexicalBlock %42 %uint_11 %uint_1 %62
%66 = OpExtInst %void %1 DebugLexicalBlock %42 %uint_15 %uint_33 %65
Both 'i' variables have the same lexical block.

An examination of LLVM reveals that this can be solved by considering the for-loop controls to be a DebugLexicalScope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions