[all-commits] [llvm/llvm-project] 035794: [Flang][OpenMP] More elegantly handle declare targ...

agozillon via All-commits all-commits at lists.llvm.org
Tue Jul 2 22:08:14 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 03579455bd941da6278f883ed8827ef0fbeb5e50
      https://github.com/llvm/llvm-project/commit/03579455bd941da6278f883ed8827ef0fbeb5e50
  Author: agozillon <Andrew.Gozillon at amd.com>
  Date:   2024-07-03 (Wed, 03 Jul 2024)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    A flang/test/Lower/OpenMP/declare-target-unnamed-main.f90

  Log Message:
  -----------
  [Flang][OpenMP] More elegantly handle declare target in unnamed program (#95834)

This PR is related to the following issue:

https://github.com/llvm/llvm-project/issues/63362

It tries to solve the crash (which is now slightly different, since the
issue has been languishing for a while sorry about that I missed the
original issue ping).

The crash occurs due to trying to access the symbol of an
undefined/unnamed main when trying to find a declare target symbol that
has not been specified (but can be assumed based on it's residence in a
function or interface).

The solution in this PR will check if we're trying to retrieve a main
symbol, and then if that is the case, we make sure it exists (due to
being named) before we attempt to retrieve it, this avoids the crash.

However, that's only part of the issue in the above example, the other
is the significant amount of nested directives, I think we are still a
little while away from handling this, I have added a reduced variation
of the test in the issue as a replicator which contains a lesser number
of nesting directives. To push the issue along further, it will likely
be a case of working through a number of variations of nested directives
in conjunction with target + parallel.

However, this PR pushes the issue above to the point where the issue
encountered is identical to the following:
https://github.com/llvm/llvm-project/issues/67231



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