Skip to content

Fix empty DW_AT_location for reused loop variables#811

Open
jiel-nv wants to merge 3 commits intoNVIDIA:mainfrom
jiel-nv:empty-location
Open

Fix empty DW_AT_location for reused loop variables#811
jiel-nv wants to merge 3 commits intoNVIDIA:mainfrom
jiel-nv:empty-location

Conversation

@jiel-nv
Copy link
Contributor

@jiel-nv jiel-nv commented Feb 26, 2026

Nvbug5886953 exposes an issue that reused loop index variables have a DWARF location list with corrupted entries.

The root cause is in the base class Lower.loadvar, which suppresses !dbg metadata on loads of function argument variables. This causes NVVM to emit .loc line 0 between the loops, and ptxas builds a multi-entry location list where the line-0 ranges inserted between entries corrupt it, producing an empty DW_AT_location in the final DWARF.

This PR overrides loadvar in CUDALower to skip the suppression. The suppression is unnecessary because loadvar is never called during the prologue — arg unpacking in lower_assign and storevar already handle suppression there.

Also add test_arg_load_has_dbg_location regression test.

Fixes nvbug5886953.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 26, 2026

Automatic reviews are disabled for this repository.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 26, 2026

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jiel-nv jiel-nv added the 2 - In Progress Currently a work in progress label Feb 26, 2026
@jiel-nv
Copy link
Contributor Author

jiel-nv commented Feb 26, 2026

/ok to test 3c986d5

@jiel-nv
Copy link
Contributor Author

jiel-nv commented Feb 26, 2026

/ok to test 518d94b

@jiel-nv jiel-nv added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Feb 27, 2026
@jiel-nv jiel-nv requested a review from gmarkall February 27, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant