flang-compiler / f18-llvm-project

Fork of llvm/llvm-project for f18. In sync with f18-mlir and f18.
http://llvm.org
28 stars 16 forks source link

[Flang] Fix issues with double and re-privatisation #1559

Closed kiranchandramohan closed 2 years ago

kiranchandramohan commented 2 years ago

-> Loop index variables are separately privatised in Flang. If these variables occur as part of a privatisation clause then do not double privatise them.

-> Allow the privatisation of an already privatised variable. This requires that we always push SymbolStack in an OpenMPConstruct.

-> If we do a shallow lookup and not find a symbol then it is OK to add a new binding at the topmost level. For this purpose use bindIfNewSymbol instead of bindSymbol.

-> Adds a testcase and corrects a few testcases.

This fixes a few issues seen in SNAP and Spec OMP 2012 (https://github.com/llvm/llvm-project/issues/54473).