Kareem Ergawy
6333f8457c
[flang][OpenMP] Move reductions from loop to teams when loop is mapped to distribute ( #132920 )
...
Follow-up to #132003 , in particular, see
https://github.com/llvm/llvm-project/pull/132003#issuecomment-2739701936 .
This PR extends reduction support for `loop` directives. Consider the
following scenario:
```fortran
subroutine bar
implicit none
integer :: x, i
!$omp teams loop reduction(+: x)
DO i = 1, 5
call foo()
END DO
end subroutine
```
Note the following:
* According to the spec, the `reduction` clause will be attached to
`loop` during earlier stages in the compiler.
* Additionally, `loop` cannot be mapped to `distribute parallel for` due
to the call to a foreign function inside the loop's body.
* Therefore, `loop` must be mapped to `distribute`.
* However, `distribute` does not have `reduction` clauses.
* As a result, we have to move the `reduction`s from the `loop` to its
parent `teams` directive, which is what is done by this PR.
2025-04-04 06:20:51 +02:00
..
2025-03-21 11:41:04 +01:00
2024-12-13 21:44:43 +09:00
2025-04-01 10:26:14 +01:00
2025-03-21 11:41:04 +01:00
2025-03-20 15:48:45 +00:00
2025-03-20 15:48:45 +00:00
2025-02-06 19:11:04 +01:00
2025-03-21 14:04:37 +01:00
2025-03-21 14:04:37 +01:00
2025-03-21 14:04:37 +01:00
2025-03-21 14:04:37 +01:00
2025-01-31 09:35:26 +00:00
2025-03-21 11:41:04 +01:00
2024-10-01 16:18:36 +01:00
2025-03-21 11:41:04 +01:00
2025-04-01 11:35:44 +05:30
2025-02-28 10:04:16 +00:00
2025-01-31 09:35:26 +00:00
2025-03-29 15:39:12 +01:00
2025-03-29 15:39:12 +01:00
2025-03-21 14:04:37 +01:00
2025-03-20 15:48:45 +00:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2025-04-02 15:16:33 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-09-26 08:56:41 -05:00
2024-11-27 14:20:34 +00:00
2024-11-16 12:28:37 +01:00
2025-02-06 19:11:04 +01:00
2024-07-31 14:39:06 -03:00
2025-03-21 11:41:04 +01:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-02-20 10:31:34 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-02-06 19:11:04 +01:00
2025-02-06 14:27:41 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-01-31 09:35:26 +00:00
2025-03-20 15:48:45 +00:00
2025-01-31 09:35:26 +00:00
2024-11-16 12:28:37 +01:00
2025-02-20 10:31:34 +00:00
2025-03-07 05:44:39 +01:00
2024-10-01 16:18:36 +01:00
2025-03-18 14:07:41 +01:00
2025-01-31 09:35:26 +00:00
2024-08-02 09:46:34 +02:00
2024-10-01 16:18:36 +01:00
2025-03-21 11:41:04 +01:00
2025-01-14 14:05:50 +00:00
2025-01-14 14:05:50 +00:00
2025-01-14 14:05:50 +00:00
2025-04-03 15:06:19 +01:00
2025-03-10 08:11:01 -05:00
2025-03-21 11:41:04 +01:00
2025-02-06 19:11:04 +01:00
2025-04-03 15:06:19 +01:00
2024-08-29 11:46:23 +01:00
2025-01-31 09:35:26 +00:00
2025-03-21 11:41:04 +01:00
2025-03-06 12:19:34 +00:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-01-03 16:46:15 +01:00
2025-02-06 19:11:04 +01:00
2024-10-04 15:24:00 +02:00
2025-04-04 06:20:51 +02:00
2025-03-21 11:41:04 +01:00
2024-11-16 12:28:37 +01:00
2025-03-20 15:48:45 +00:00
2025-03-07 22:22:30 +01:00
2024-10-30 10:58:26 +00:00
2024-10-30 10:58:26 +00:00
2024-08-30 09:07:30 -04:00
2025-02-27 14:32:25 -05:00
2025-03-13 15:50:37 +01:00
2024-08-02 10:54:15 +01:00
2025-03-28 14:19:20 +00:00
2025-03-18 14:07:41 +01:00
2025-01-31 11:43:29 -08:00
2025-03-21 11:41:04 +01:00
2024-10-30 10:58:26 +00:00
2024-10-30 10:58:26 +00:00
2024-10-30 10:58:26 +00:00
2025-03-21 11:41:04 +01:00
2025-02-12 11:04:26 +01:00
2025-03-21 11:41:04 +01:00
2025-03-24 09:48:41 -03:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2024-08-22 14:12:07 +01:00
2024-10-03 17:10:57 +02:00
2024-10-03 17:10:57 +02:00
2025-03-11 02:01:57 +00:00
2025-03-24 09:48:41 -03:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-02-06 19:11:04 +01:00
2025-02-06 19:11:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 14:04:37 +01:00
2025-01-31 09:35:26 +00:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-11 09:38:40 -03:00
2025-03-05 14:23:59 -06:00
2025-03-24 09:48:41 -03:00
2025-03-11 10:16:48 +00:00
2025-01-13 12:31:29 +00:00
2025-04-02 10:43:48 +01:00
2025-01-31 09:35:26 +00:00
2025-03-21 11:41:04 +01:00
2024-10-01 16:18:36 +01:00
2024-10-01 16:18:36 +01:00
2025-03-21 14:04:37 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 14:04:37 +01:00
2024-11-11 11:18:21 +00:00
2025-03-21 11:41:04 +01:00
2025-04-02 20:00:09 +02:00
2025-03-12 19:41:11 -05:00
2025-01-14 13:55:17 +00:00
2025-04-01 10:26:14 +01:00
2025-01-31 09:35:26 +00:00
2024-12-10 03:25:06 -08:00
2025-04-01 10:26:14 +01:00
2025-04-01 10:26:14 +01:00
2025-03-21 11:41:04 +01:00
2025-03-19 10:12:52 +00:00
2025-03-21 11:41:04 +01:00
2025-03-21 14:04:37 +01:00
2025-03-21 11:41:04 +01:00
2024-11-26 09:21:13 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2024-10-03 17:10:57 +02:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2024-11-14 15:47:37 +01:00
2024-11-19 16:58:30 +09:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-02-06 19:11:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-24 09:48:41 -03:00
2025-03-21 11:41:04 +01:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2025-03-24 09:48:41 -03:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-02-06 19:11:04 +01:00
2025-02-06 19:11:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-02-06 19:11:04 +01:00
2025-03-24 09:48:41 -03:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2024-11-04 10:32:48 +00:00
2025-02-06 19:11:04 +01:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00