[flang-commits] [flang] [flang][OpenMP] Enable lastprivate with collapse (PR #93778)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Mon Jun 3 01:49:10 PDT 2024


https://github.com/luporl commented:

As @kiranchandramohan mentioned, `DataSharingProcessor::insertLastPrivateCompare` is currently assuming collapse == 1.

While this patch may produce correct results, it would result in the lastprivate variable being assigned to on every iteration of the inner loops, when on the last iteration of the outer loop, which doesn't seem right.

However, checking all related iteration variables during many iterations would not be very efficient. IIRC, some time ago it was suggested that lastprivate handling should be moved to `omp` dialect, to make it possible to update the lastprivate variable in the end of the loop and avoid iteration variable comparisons.

https://github.com/llvm/llvm-project/pull/93778


More information about the flang-commits mailing list