llvm / llvm/llvm-project

[flang][OpenMP][debug] runtime calls in a reducing worksharing construct are attributed to a line in a different subroutine

Open
#222,305 0 comments 0 reactions 1 assignee Claimed by @abidh View on GitHub
flang:openmp
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Consider the following testcase:

```fortran
subroutine first_user(a, s)
integer :: a, s, i
s = 0
!$omp parallel do reduction(+:s) ! line 4
do i = 1, 4
s = s + a
end do
!$omp end parallel do
end subroutine first_user

subroutine second_user(a, s)
integer :: a, s, i
s = 0
!$omp parallel do reduction(+:s) ! line 14
do i = 1, 4
s = s + a
end do
!$omp end parallel do
end subroutine second_user
```

```
flang -fopenmp -g -O0 -S -emit-llvm test.f90
```

Inside `second_user_..omp_par`, many runtime call reports line 4, which is `first_user`'s directive.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.