[all-commits] [llvm/llvm-project] 750b96: [flang][debug] Do not scope device subprograms at ...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Tue Sep 22 04:10:26 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 750b967f7bf80e08306a42c5d1cfd26d5d1ba56a
      https://github.com/llvm/llvm-project/commit/750b967f7bf80e08306a42c5d1cfd26d5d1ba56a
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
    A flang/test/Transforms/debug-omp-target-internal-proc.fir

  Log Message:
  -----------
  [flang][debug] Do not scope device subprograms at the host procedure. (#225121)

A target device module holds the internal procedures and the outlined
target regions, but not the host procedure they are contained in, which
only the host runs. Scoping them at it leaves a DW_TAG_subprogram with
no code as their parent, and a debugger does not look inside such a
subtree, so the variables of a device internal procedure, and of a
kernel outlined from one, cannot be read even though they are in the
DWARF.

Scope them at the file instead when compiling for the device. Nothing on
the device reads a variable through the host procedure's scope. An
omp.target region is IsolatedFromAbove, so a variable of the host that
the region uses is brought in as one of the region's own arguments
rather than through host association, and a declare target internal
procedure that does need the host association tuple cannot be called
from a target region at all, because passing the tuple in would be the
same violation. Only the name qualification is lost: a frame prints
"add" rather than "test::add", and the full nesting is still in the
linkage name.

Fixes https://github.com/llvm/llvm-project/issues/225101

Co-authored-by: Cursor <cursoragent at cursor.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list