[PATCH] D21564: [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for'

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 20:53:19 PDT 2016


ABataev requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: lib/CodeGen/CGStmtOpenMP.cpp:1868-1871
@@ -1867,1 +1867,6 @@
 
+void CodeGenFunction::EmitOMPDistributeParallelForDirective(
+    const OMPDistributeParallelForDirective &S) {
+  EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());
+}
+
----------------
No, it won't work. Use the following code:
```
OMPLexicalScope Scope(*this, S, /*AsInlined=*/true);
CGM.getOpenMPRuntime().emitInlinedDirective(
  *this, OMPD_distribute_parallel_for, [&S](CodeGenFunction &CGF, PrePostActionTy &) {
  OMPLoopScope PreInitScope(CGF, S);
  CGF.EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());
});
```

================
Comment at: lib/Sema/SemaOpenMP.cpp:4985-4987
@@ +4984,5 @@
+
+      PrevLBDecl->setType(VType);
+      PrevUBDecl->setType(VType);
+
+      // Previous lower and upper bounds are obtained from the region
----------------
Not sure that this is a good solution. I'd prefer not to change the types of parameters. Maybe it is better to pass them as pointers and then cast to proper types?


Repository:
  rL LLVM

http://reviews.llvm.org/D21564





More information about the cfe-commits mailing list