[OPENMP]Fix PR50733: unexpected final value of list-item in linear clause in loop...
authorAlexey Bataev <a.bataev@outlook.com>
Tue, 29 Jun 2021 20:56:00 +0000 (13:56 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Thu, 2 Dec 2021 22:10:41 +0000 (14:10 -0800)
commit8a2c7a2410994ff277e8761c3b33d1b225be704c
treece4446f9a3650d712e17bf36fca67c4d070f842a
parentc27734c183707247b43b215d3cf55c3dbc60ef5d
[OPENMP]Fix PR50733: unexpected final value of list-item in linear clause in loop construct.

Currently the last value of linear is calculated as var = init + num_iters * step.
Replaced it with var = var_priv, i.e. original variable gets the value
of the last private copy.

Differential Revision: https://reviews.llvm.org/D105151
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/for_linear_codegen.cpp
clang/test/OpenMP/for_simd_codegen.cpp
clang/test/OpenMP/parallel_for_linear_codegen.cpp
clang/test/OpenMP/parallel_for_simd_codegen.cpp
clang/test/OpenMP/parallel_master_taskloop_simd_lastprivate_codegen.cpp
clang/test/OpenMP/simd_codegen.cpp
clang/test/OpenMP/target_parallel_for_codegen.cpp
clang/test/OpenMP/target_parallel_for_simd_codegen.cpp