[all-commits] [llvm/llvm-project] 641949: [flang][OMPIRBuilder] Keep debug location in sync ...

Abid Qadeer via All-commits all-commits at lists.llvm.org
Fri May 10 02:12:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 641949654910a533076e35517d084e2961adbdfa
      https://github.com/llvm/llvm-project/commit/641949654910a533076e35517d084e2961adbdfa
  Author: Abid Qadeer <haqadeer at amd.com>
  Date:   2024-05-10 (Fri, 10 May 2024)

  Changed paths:
    A flang/test/Integration/debug-loc-1.f90
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

  Log Message:
  -----------
  [flang][OMPIRBuilder] Keep debug location in sync with insert point. (#89953)

A customer reported an issue which I have reduced to the test in the PR.
If built with debug info enabled, the build fails with the following
error in the verifier.

!dbg attachment points at wrong subprogram for function

The problem happened because some of the functions in OMPIRBuilder.cpp
updated the insertion point with the passed in location but did not
change the current debug location. This caused a stale debug location to
be attached to the instruction.

I have solved it by replacing restoreIP with updateToLocation which
updates both the insertion point and debug location. The
updateToLocation is used in many places already, so this PR brings
functions that I have changed in line with rest of the file.

Slight issue is that I am not checking the return type of
updateToLocation as there is no good value I could return in that case.
But if we have a condition where updateToLocation will return false,
these functions will fail in any case.

I have added a test that checks that build does not fail. I was not sure
what is the correct location for the test should be. Happy to move it to
more appropriate location.



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