You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
program nowait_reproducer
implicit none
real x
!$omp target map(tofrom: x) nowait
x = x + 1
!$omp end target
end program nowait_reproducer
This is what I get when I try to compile it with -g.
flang -g -O0 test.f90 -fopenmp
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
inlinable function call in a function with debug info must have a !dbg location
call void @__omp_offloading_10302_4986ae0__QQmain_l10(ptr %1)
error: failed to create the LLVM module
The text was updated successfully, but these errors were encountered:
program nowait_reproducer
implicit none
real x
!$omp target map(tofrom: x) nowait
x = x + 1
!$omp end target
end program nowait_reproducer
This is what I get when I try to compile it with -g.
flang -g -O0 test.f90 -fopenmp
flang-20: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
inlinable function call in a function with debug info must have a !dbg location
call void @<!-- -->__omp_offloading_10302_4986ae0__QQmain_l10(ptr %1)
error: failed to create the LLVM module
abidh
added a commit
to abidh/llvm-project
that referenced
this issue
Jan 30, 2025
While working on llvm#125088, I
noticed a problem with the TargetBodyGenCallbackTy and
TargetGenArgAccessorsCallbackTy. The OMPIRBuilder and MLIR side Both
maintain their own IRBuilder and when control goes from one to other,
we have to take care to not use a stale debug location. The code
currently rely on restoreIP to set the insertion point and the debug
location. But if the passes InsertPointTy has an empty block,
then the debug location will not be updated (see SetInsertPoint).
This can cause invalid debug location to be attached to instruction and
the verifier will complain.
Similarly when we exit the callback, the debug location of the Builder
is not set to what it was before the callback. This again can cause
verification failures.
This PR resets the debug location at the start and also uses an
InsertPointGuard to restore the debug location at exit.
Both of these problems would have been caught by the unit tests but
they were not setting the debug location of the builder before calling
the createTarget so the problem was hidden. I have updated the tests
accordingly.
Please see the testcase below.
This is what I get when I try to compile it with -g.
The text was updated successfully, but these errors were encountered: