File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -1801,14 +1801,16 @@ class FirConverter : public Fortran::lower::AbstractConverter {
1801
1801
std::get_if<Fortran::parser::LocalitySpec::LocalInit>(&x.u ))
1802
1802
for (const Fortran::parser::Name &x : localInitList->v )
1803
1803
info.localInitSymList .push_back (x.symbol );
1804
- if (const auto *reduceList =
1805
- std::get_if<Fortran::parser::LocalitySpec::Reduce>(&x.u )) {
1806
- fir::ReduceOperationEnum reduce_operation = getReduceOperationEnum (
1807
- std::get<Fortran::parser::ReductionOperator>(reduceList->t ));
1808
- for (const Fortran::parser::Name &x :
1809
- std::get<std::list<Fortran::parser::Name>>(reduceList->t )) {
1810
- info.reduceSymList .push_back (
1811
- std::make_pair (reduce_operation, x.symbol ));
1804
+ for (IncrementLoopInfo &info : incrementLoopNestInfo) {
1805
+ if (const auto *reduceList =
1806
+ std::get_if<Fortran::parser::LocalitySpec::Reduce>(&x.u )) {
1807
+ fir::ReduceOperationEnum reduce_operation = getReduceOperationEnum (
1808
+ std::get<Fortran::parser::ReductionOperator>(reduceList->t ));
1809
+ for (const Fortran::parser::Name &x :
1810
+ std::get<std::list<Fortran::parser::Name>>(reduceList->t )) {
1811
+ info.reduceSymList .push_back (
1812
+ std::make_pair (reduce_operation, x.symbol ));
1813
+ }
1812
1814
}
1813
1815
}
1814
1816
if (const auto *sharedList =
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ subroutine loop_test
12
12
13
13
! CHECK: %[[VAL_0:.*]] = fir.alloca f32 {bindc_name = "m", uniq_name = "_QFloop_testEm"}
14
14
! CHECK: %[[VAL_1:.*]] = fir.address_of(@_QFloop_testEsum) : !fir.ref<i32>
15
- ! CHECK: fir.do_loop %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} unordered {
16
- ! CHECK: fir.do_loop %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} unordered {
15
+ ! CHECK: fir.do_loop %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} unordered reduce(#fir.reduce_attr<add> -> %[[VAL_1:.*]] : !fir.ref<i32>, #fir.reduce_attr<max> -> %[[VAL_0:.*]] : !fir.ref<f32>) {
16
+ ! CHECK: fir.do_loop %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} unordered reduce(#fir.reduce_attr<add> -> %[[VAL_1:.*]] : !fir.ref<i32>, #fir.reduce_attr<max> -> %[[VAL_0:.*]] : !fir.ref<f32>) {
17
17
! CHECK: fir.do_loop %{{.*}} = %{{.*}} to %{{.*}} step %{{.*}} unordered reduce(#fir.reduce_attr<add> -> %[[VAL_1:.*]] : !fir.ref<i32>, #fir.reduce_attr<max> -> %[[VAL_0:.*]] : !fir.ref<f32>) {
18
18
do concurrent (i= 1 :5 , j= 1 :5 , k= 1 :5 ) local(tmp) reduce(+ :sum) reduce(max:m)
19
19
tmp = i + j + k
You can’t perform that action at this time.
0 commit comments