[flang-commits] [flang] [mlir] [flang][openmp] Changes for invoking scan Op (PR #123254)
Sergio Afonso via flang-commits
flang-commits at lists.llvm.org
Thu Jan 23 03:48:30 PST 2025
================
@@ -0,0 +1,34 @@
+!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s
+
+subroutine inclusive_scan
+ implicit none
+ integer, parameter :: n = 100
+ integer a(n), b(n)
+ integer x, k
+
+ !CHECK: omp.wsloop reduction(mod: inscan, {{.*}}) {
----------------
skatrak wrote:
I think it would be good to check that the block argument defined by the `omp.wsloop` operation for the reduction variable is what's eventually passed to `omp.scan`. Something like:
```f90
! CHECK: omp.wsloop reduction(mod: inscan, %{{.*}} -> %[[RED_ARG:.*]] : {{.*}}) {
! CHECK: %[[RED_DECL:.*]]:2 = hlfir.declare %[[RED_ARG]]
! CHECK: omp.scan inclusive(%[[RED_DECL]]#0 : {{.*}})
```
https://github.com/llvm/llvm-project/pull/123254
More information about the flang-commits
mailing list