Skip to content

Conversation

adam-yang
Copy link
Contributor

@adam-yang adam-yang commented Oct 4, 2025

Previously, global variables converted to alloca's, their debug info is written as a dbg.value for a fake local variable prefixed with "global.". This was only done for the entry function's DISubprogram, which makes the variable inaccessible for all inlined function scopes.

This change creates a dbg.value for each inlined DISubprogram, each pointing to a new DILocalVariable with the inlined DISubprogram as its scope.

Copy link
Contributor

github-actions bot commented Oct 4, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@adam-yang adam-yang self-assigned this Oct 6, 2025
@adam-yang adam-yang marked this pull request as ready for review October 6, 2025 21:08
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better if this were an IR to IR test rather than HLSL to IR running the full pipeline.

DXC's hacked up SROA is quite messy and massively under tested. The ExtractIRForPassTest.py script should be able to turn this source into an IR test pretty easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. Can I also keep this HLSL test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an IR test. I want to keep the HLSL test too just to verify end-to-end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants