[all-commits] [llvm/llvm-project] 196a1a: [OMPIRBuilder][debug] Fix debug info for variables...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Mon Feb 10 10:56:57 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 196a1acc7d277d05d4b94ad7745c18bf13ea991f
      https://github.com/llvm/llvm-project/commit/196a1acc7d277d05d4b94ad7745c18bf13ea991f
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2025-02-10 (Mon, 10 Feb 2025)

  Changed paths:
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    A mlir/test/Target/LLVMIR/omptarget-debug-var-1.mlir
    A mlir/test/Target/LLVMIR/omptarget-debug-var-2.mlir

  Log Message:
  -----------
  [OMPIRBuilder][debug] Fix debug info for variables in target region. (#118314)

When a new function is created to handle OpenMP target region, the
variables used in it are passed as arguments. The scope and the location
of these variable contains still point to te parent function of the
target region. Such variables will fail in Verifier as the scope of the
variables will be different from the containing functions.

Currently, flang is the only user of createOutlinedFunction and it does
not generate any debug data for the the variables in the target region
to avoid this error. When this PR is in, we should be able to remove
this limit in the flang (and anyother client) and have the better debug
experience for the target region.

This PR changes the location and scope of the variables in the target
region to point to correct entities. It is similar to what
fixupDebugInfoPostExtraction does for CodeExtractor. I initially tried
to re-use that function but found quickly that it would require quite a
bit of re-factoring and additions before it could be used. It was much
simpler to make the changes locally.



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