Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flang/lib/Lower/Bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2128,8 +2128,8 @@ class FirConverter : public Fortran::lower::AbstractConverter {
bool result = rp.processReductionArguments<fir::DeclareReductionOp>(
toLocation(), *this, info.reduceOperatorList, reduceVars,
reduceVarByRef, reductionDeclSymbols, info.reduceSymList);
assert(result && "Failed to process `do concurrent` reductions");
(void)result;
if (!result)
TODO(toLocation(), "Lowering unrecognised reduction type");

doConcurrentLoopOp.getReduceVarsMutable().assign(reduceVars);
doConcurrentLoopOp.setReduceSymsAttr(
Expand Down
6 changes: 3 additions & 3 deletions flang/lib/Lower/OpenMP/ClauseProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ bool ClauseProcessor::processInReduction(
std::get<typename omp::clause::ReductionOperatorList>(clause.t),
inReductionVars, inReduceVarByRef, inReductionDeclSymbols,
inReductionSyms))
inReductionSyms.clear();
TODO(currentLocation, "Lowering unrecognised reduction type");

// Copy local lists into the output.
llvm::copy(inReductionVars, std::back_inserter(result.inReductionVars));
Expand Down Expand Up @@ -1467,7 +1467,7 @@ bool ClauseProcessor::processReduction(
std::get<typename omp::clause::ReductionOperatorList>(clause.t),
reductionVars, reduceVarByRef, reductionDeclSymbols,
reductionSyms))
reductionSyms.clear();
TODO(currentLocation, "Lowering unrecognised reduction type");
// Copy local lists into the output.
llvm::copy(reductionVars, std::back_inserter(result.reductionVars));
llvm::copy(reduceVarByRef, std::back_inserter(result.reductionByref));
Expand All @@ -1494,7 +1494,7 @@ bool ClauseProcessor::processTaskReduction(
std::get<typename omp::clause::ReductionOperatorList>(clause.t),
taskReductionVars, taskReduceVarByRef, taskReductionDeclSymbols,
taskReductionSyms))
taskReductionSyms.clear();
TODO(currentLocation, "Lowering unrecognised reduction type");
// Copy local lists into the output.
llvm::copy(taskReductionVars,
std::back_inserter(result.taskReductionVars));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Tests reduction processor behavior when a reduction symbol is not supported.

! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s
! RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s

subroutine foo
implicit none
Expand All @@ -12,14 +12,9 @@ function max(m1,m2)
end function
end interface

!CHECK: not yet implemented: Lowering unrecognised reduction type
!$omp do reduction (max: k)
do i=1,10
end do
!$omp end do
end

! Verify that unsupported reduction is ignored.
! CHECK: omp.wsloop
! CHECK-SAME: private(@{{[^[:space:]]+}} %{{[^[:space:]]+}}
! CHECK-SAME: -> %{{[^[:space:]]+}} : !{{[^[:space:]]+}}) {
! CHECK: }