Skip to content

[FEA] Add support for typed constant in debug info metadata emission.#1326

Merged
esc merged 2 commits intonumba:mainfrom
jiel-nv:typed-const
Oct 23, 2025
Merged

[FEA] Add support for typed constant in debug info metadata emission.#1326
esc merged 2 commits intonumba:mainfrom
jiel-nv:typed-const

Conversation

@jiel-nv
Copy link
Contributor

@jiel-nv jiel-nv commented Oct 9, 2025

Add support for typed constants in debug info metadata fields (like extraData in DIDerivedType):

e.g.
!8 = !DIDerivedType(tag: DW_TAG_member, ... , extraData: i32 1)
or
!24 = !DIDerivedType(tag: DW_TAG_member, ... , extraData: i8 2)

The extraData field should be LLVM IR ConstantAsMetadata wrapping a typed constant (like ConstantInt) in LLVM IR text format which appears as typed constants like:
i32 1
i8 2

Also add a llvmlite test to guard this change.

I have tested this change with the Numba and Numba-CUDA debuginfo tests locally as well, with no issues.

@jiel-nv
Copy link
Contributor Author

jiel-nv commented Oct 10, 2025

The CI failure should be cleared once PR#1325 is in. @swap357
Could you please review this change? @gmarkall

@swap357
Copy link
Contributor

swap357 commented Oct 10, 2025

The CI failure should be cleared once PR#1325 is in. @swap357 Could you please review this change? @gmarkall

Thank you for the PR, @jiel-nv.
about CI failures, I do not think PR#1325 has anything to do with PR checks being run here. From logs here -
https://dev.azure.com/numba/numba/_build/results?buildId=19979&view=logs&j=c32913f0-c98d-5e24-2f8e-6294d1cfd8e0&t=66f0d9e4-d5b5-5af3-0bcb-f619e9fb3708&l=182
they seem to be flake8 errors that might need correction on patch itself

@jiel-nv
Copy link
Contributor Author

jiel-nv commented Oct 10, 2025

Thank you for the PR, @jiel-nv. about CI failures, I do not think PR#1325 has anything to do with PR checks being run here. From logs here - https://dev.azure.com/numba/numba/_build/results?buildId=19979&view=logs&j=c32913f0-c98d-5e24-2f8e-6294d1cfd8e0&t=66f0d9e4-d5b5-5af3-0bcb-f619e9fb3708&l=182 they seem to be flake8 errors that might need correction on patch itself

Thank you @swap357. I've submitted a fix.

Copy link
Member

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

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

Thanks for the PR - this looks good to me. I've checked it aligns with other IR documented in the LLVM Language reference manual, e.g. https://llvm.org/docs/LangRef.html#ditemplatevalueparameter which gives value: i32 7 as an example. I also notes that the use of typed constants is consistent with general usage in metadata nodes (c.f. https://llvm.org/docs/LangRef.html#metadata-nodes-mdnode).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants