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-04-03 14:19:31 -07:00
2025-03-11 15:19:43 +01:00
2025-03-21 11:41:04 +01:00
2025-04-03 15:33:40 -07:00
2025-01-31 11:43:29 -08:00
2025-03-21 11:41:04 +01:00
2025-04-04 06:20:51 +02:00
2025-02-07 11:23:09 -05:00
2025-02-13 08:08:09 -08:00
2025-02-24 15:02:34 +01:00
2025-03-21 11:41:04 +01:00
2025-01-16 12:34:38 -08:00
2025-01-16 12:34:38 -08:00
2025-03-21 11:41:04 +01:00
2025-01-16 12:34:38 -08:00
2025-01-16 12:34:38 -08:00
2025-03-21 11:41:04 +01:00
2024-10-03 17:10:57 +02:00
2025-04-03 08:37:40 -07:00
2024-12-10 16:26:53 +09:00
2025-02-28 09:50:05 +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
2024-12-10 16:26:53 +09:00
2024-12-10 16:26:53 +09:00
2025-01-07 08:35:43 -08:00
2025-02-24 14:18:17 -08:00
2024-09-25 16:45:47 +02:00
2025-02-05 18:24:47 +00:00
2025-01-31 11:43:29 -08:00
2024-11-14 14:18:26 +09:00
2025-01-30 18:42:13 +01:00
2024-09-26 11:11:44 +02:00
2024-09-16 12:33:37 +01:00
2025-02-28 09:50:05 +01:00
2025-02-28 09:50:05 +01:00
2024-10-03 17:10:57 +02:00
2025-03-21 11:41:04 +01:00
2025-02-28 09:50:05 +01:00
2025-02-28 09:50:05 +01:00
2025-02-24 15:02:34 +01:00
2024-09-16 16:27:11 +02:00
2024-09-26 11:11:44 +02:00
2025-02-24 15:02:34 +01:00
2024-06-25 15:42:02 +01:00
2025-02-24 15:02:34 +01:00
2024-06-04 11:15:31 -07:00
2025-02-13 09:24:38 +01:00
2025-03-19 12:52:59 -07:00
2024-10-03 17:10:57 +02:00
2025-03-21 11:41:04 +01:00
2024-09-16 12:33:37 +01:00
2025-02-05 18:24:47 +00:00
2024-08-15 10:04:49 +02:00
2025-03-11 15:19:43 +01:00
2024-08-21 13:37:03 -07:00
2025-02-28 09:50:05 +01:00
2025-02-24 15:02:34 +01:00
2025-02-28 09:50:05 +01:00
2025-03-11 15:19:43 +01:00
2025-03-21 11:41:04 +01:00
2025-01-13 10:52:09 -05:00
2025-02-28 09:50:05 +01:00
2025-01-16 12:34:38 -08:00
2024-10-31 09:19:18 +01:00
2024-12-10 16:26:53 +09:00
2024-12-10 16:26:53 +09:00
2024-06-18 12:04:04 +02:00
2024-06-18 12:04:04 +02:00
2024-09-16 12:33:37 +01:00
2025-01-23 10:23:50 -05:00
2025-02-03 18:09:01 +01:00
2025-03-21 11:41:04 +01:00
2025-02-28 09:50:05 +01:00
2025-02-05 18:24:47 +00:00
2024-12-03 10:04:52 +01:00
2024-12-03 10:04:52 +01:00
2025-01-16 12:34:38 -08:00
2025-01-27 10:51:23 +01:00
2024-09-26 11:11:44 +02:00
2024-12-10 16:26:53 +09:00
2025-01-16 12:34:38 -08:00
2024-09-16 12:33:37 +01:00
2024-12-10 16:26:53 +09:00
2024-08-16 19:56:22 -04:00
2025-02-28 09:50:05 +01:00
2024-10-03 17:10:57 +02:00
2024-12-10 16:26:53 +09:00
2025-03-21 11:41:04 +01:00
2025-03-21 11:41:04 +01:00
2025-02-28 09:50:05 +01:00
2024-12-10 16:26:53 +09:00
2025-01-16 12:34:38 -08:00
2024-09-16 12:33:37 +01:00
2024-07-03 18:49:42 +01:00
2024-07-23 09:49:17 -07:00
2024-07-23 09:49:17 -07:00
2024-07-23 09:49:17 -07:00
2024-12-10 16:26:53 +09:00
2024-06-17 09:21:30 -07:00
2024-07-03 21:38:27 +01:00
2024-12-10 16:26:53 +09:00
2024-06-04 11:15:31 -07:00
2025-02-05 18:24:47 +00:00
2024-09-02 13:48:39 +02:00
2024-12-20 10:37:48 -08:00
2025-01-16 12:34:38 -08:00
2024-11-28 08:58:09 +09:00
2025-03-21 11:41:04 +01:00
2025-01-16 12:34:38 -08:00
2025-02-28 09:50:05 +01:00
2025-02-05 18:24:47 +00:00
2025-02-28 09:50:05 +01:00
2025-01-16 12:34:38 -08:00
2025-03-11 15:19:43 +01:00
2025-01-16 12:34:38 -08:00
2024-06-04 11:15:31 -07:00
2024-10-03 17:10:57 +02:00
2025-02-28 09:50:05 +01:00
2025-02-28 09:50:05 +01:00
2025-02-27 14:28:08 -08:00
2024-06-12 09:35:14 -04:00
2024-09-26 11:11:44 +02:00
2025-02-13 09:24:38 +01:00
2025-01-31 11:43:29 -08:00
2024-12-17 09:06:05 -08:00
2024-10-14 08:44:24 -06:00
2025-03-19 17:12:32 -07:00
2025-03-19 17:12:32 -07:00
2025-03-19 17:12:32 -07:00
2025-04-03 10:43:28 -07:00
2025-01-16 12:34:38 -08:00
2025-02-28 09:50:05 +01:00
2024-10-03 17:10:57 +02:00
2025-01-16 12:34:38 -08:00
2025-03-21 11:41:04 +01:00
2025-02-28 09:50:05 +01:00
2025-01-16 12:34:38 -08:00
2025-01-23 10:23:50 -05:00
2024-07-17 08:53:29 +00:00
2025-04-02 14:30:01 +02:00
2025-01-29 09:44:09 +01:00
2024-12-18 07:02:37 -08:00
2025-04-02 14:30:01 +02:00
2025-01-16 12:34:38 -08:00
2025-01-21 07:57:44 +00:00
2025-01-21 07:57:44 +00:00