[all-commits] [llvm/llvm-project] 52807b: [OpenMP][Reduction] Allow PLUS (+) operator on red...
Fazlay Rabbi via All-commits
all-commits at lists.llvm.org
Thu Jul 20 14:26:13 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 52807ba3836ef30c54622f227c4a23e2eb9375cd
https://github.com/llvm/llvm-project/commit/52807ba3836ef30c54622f227c4a23e2eb9375cd
Author: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: 2023-07-20 (Thu, 20 Jul 2023)
Changed paths:
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/lib/Sema/SemaOpenMP.cpp
M clang/test/OpenMP/distribute_parallel_for_reduction_messages.cpp
M clang/test/OpenMP/distribute_parallel_for_simd_reduction_messages.cpp
M clang/test/OpenMP/distribute_simd_reduction_messages.cpp
M clang/test/OpenMP/for_reduction_messages.cpp
M clang/test/OpenMP/for_simd_reduction_messages.cpp
M clang/test/OpenMP/masked_taskloop_in_reduction_messages.cpp
M clang/test/OpenMP/masked_taskloop_simd_in_reduction_messages.cpp
M clang/test/OpenMP/masked_taskloop_simd_reduction_messages.cpp
M clang/test/OpenMP/master_taskloop_in_reduction_messages.cpp
M clang/test/OpenMP/master_taskloop_reduction_messages.cpp
M clang/test/OpenMP/master_taskloop_simd_in_reduction_messages.cpp
M clang/test/OpenMP/master_taskloop_simd_reduction_messages.cpp
M clang/test/OpenMP/parallel_for_reduction_messages.cpp
M clang/test/OpenMP/parallel_for_simd_reduction_messages.cpp
M clang/test/OpenMP/parallel_masked_reduction_messages.cpp
M clang/test/OpenMP/parallel_masked_taskloop_reduction_messages.cpp
M clang/test/OpenMP/parallel_masked_taskloop_simd_reduction_messages.cpp
M clang/test/OpenMP/parallel_master_reduction_messages.cpp
M clang/test/OpenMP/parallel_master_taskloop_reduction_messages.cpp
M clang/test/OpenMP/parallel_master_taskloop_simd_reduction_messages.cpp
M clang/test/OpenMP/parallel_reduction_messages.cpp
M clang/test/OpenMP/parallel_sections_reduction_messages.cpp
M clang/test/OpenMP/sections_reduction_messages.cpp
M clang/test/OpenMP/simd_reduction_messages.cpp
M clang/test/OpenMP/target_parallel_for_reduction_messages.cpp
M clang/test/OpenMP/target_parallel_for_simd_reduction_messages.cpp
M clang/test/OpenMP/target_parallel_reduction_messages.cpp
M clang/test/OpenMP/target_reduction_messages.cpp
M clang/test/OpenMP/target_simd_reduction_messages.cpp
M clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_messages.cpp
M clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_messages.cpp
M clang/test/OpenMP/target_teams_distribute_reduction_messages.cpp
M clang/test/OpenMP/target_teams_distribute_simd_reduction_messages.cpp
M clang/test/OpenMP/target_teams_reduction_messages.cpp
M clang/test/OpenMP/taskgroup_task_reduction_messages.cpp
M clang/test/OpenMP/taskloop_in_reduction_messages.cpp
M clang/test/OpenMP/taskloop_reduction_messages.cpp
M clang/test/OpenMP/taskloop_simd_in_reduction_messages.cpp
M clang/test/OpenMP/taskloop_simd_reduction_messages.cpp
M clang/test/OpenMP/teams_distribute_parallel_for_reduction_messages.cpp
M clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_messages.cpp
M clang/test/OpenMP/teams_distribute_reduction_messages.cpp
M clang/test/OpenMP/teams_distribute_simd_reduction_messages.cpp
M clang/test/OpenMP/teams_reduction_messages.cpp
Log Message:
-----------
[OpenMP][Reduction] Allow PLUS (+) operator on reduction clauses in OMP > 52
Currently, clang gives an incorrect reduction identifier error for the PLUS
operator for OpenMP version > 52. But, PLUS operator is allowed in OpenMP
version > 52. This revision fixes this issue and also modified the error
messages to show the correct expected operators in the message based on the OpenMP
version used (prior to OMP 6.0 and since OMP 6.0).
Test Src:
void foo() {
int a = 0 ;
#pragma omp parallel reduction(+:a)
;
#pragma omp parallel reduction(-:a)
;
}
Before this revision:
$ clang -fopenmp -fopenmp-version=60 test.c -c
test.c:3:34: error: incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'
3 | #pragma omp parallel reduction(+:a)
| ^
test.c:5:34: error: incorrect reduction identifier, expected one of '+', '-', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'
5 | #pragma omp parallel reduction(-:a)
| ^
2 errors generated.
Wit this revision:
$ clang -fopenmp -fopenmp-version=60 test.c -c
test.c:5:34: error: incorrect reduction identifier, expected one of '+', '*', '&', '|', '^', '&&', '||', 'min' or 'max' or declare reduction for type 'int'
5 | #pragma omp parallel reduction(-:a)
|
1 error generated.
Differential Revision: https://reviews.llvm.org/D155635
More information about the All-commits
mailing list