[flang-commits] [clang] [flang] [llvm] [CLANG][OpenMP] Add support for OpenMP6.0 transparent clause (PR #166810)

Zahira Ammarguellat via flang-commits flang-commits at lists.llvm.org
Thu Dec 18 02:25:02 PST 2025


================
@@ -169,6 +169,14 @@ extern const omp_impex_t omp_not_impex;
 extern const omp_impex_t omp_import;
 extern const omp_impex_t omp_export;
 extern const omp_impex_t omp_impex;
+
+template <typename T>
+void TestTaskLoopImpex() {
+#pragma omp taskloop transparent(omp_impex)
----------------
zahiraam wrote:

For:
```
template <int C>
void TestTaskLoopImpex() {
#pragma omp taskloop transparent(C)
  for (int i = 0; i < 10; ++i) {}
}

int main() {
  TestTaskLoopImpex<1>();
  return 0;
}
```
Do we want to generate this:
```
# | template <int C> void TestTaskLoopImpex() {
# |     #pragma omp taskloop transparent(C)
# |         for (int i = 0; i < 10; ++i) {
# |         }
# | }
# | template<> void TestTaskLoopImpex<**1**>() {
# |     #pragma omp taskloop transparent(**1**)
# |         for (int i = 0; i < 10; ++i) {
# |         }
# | }
# | int main() {
# |     TestTaskLoopImpex<1>();
# |     return 0;
# | }
```

or

```
# | template <int C> void TestTaskLoopImpex() {
# |     #pragma omp taskloop transparent(C)
# |         for (int i = 0; i < 10; ++i) {
# |         }
# | }
# | template<> void TestTaskLoopImpex<**omp_import**>() {
# |     #pragma omp taskloop transparent(**omp_import**)
# |         for (int i = 0; i < 10; ++i) {
# |         }
# | }
# | int main() {
# |     TestTaskLoopImpex<1>();
# |     return 0;
# | }
```
With the assumption that 0 generates `omp_not_impex`, 1 generates `omp_import`, 2 generates `omp_export` and 3 generates `omp_impex`?

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


More information about the flang-commits mailing list