carlo.bertolli added inline comments.

================
Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:7791
+    OpenMPBindClauseKind bindParam = C->getBindKind();
+    switch (bindParam) {
+    case OMPC_BIND_parallel: {
----------------
What if you have something like this:

void foo(..) {
  #pragma omp loop
  for (..) {
  }
}

int main() {

  #pragma omp target teams
  {
    ...
    foo();
   }

  #pragma omp target
   {
      #pragma omp parallel
      {
         foo();
      }
}

In the first invocation, loop is bound to teams. In the second, loop is bound 
to parallel.
This is a runtime condition.

I *believe* that not even OpenMP 6.0 TR1 allows us to decide at compile time if 
loop should be treated as worksharing or workdistribution....but I might be 
wrong.

Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144634/new/

https://reviews.llvm.org/D144634

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to