[PATCH] D102180: [Clang][OpenMP] Emit dependent PreInits before directive.

Michael Kruse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 10 10:36:52 PDT 2021


Meinersbur added inline comments.


================
Comment at: clang/lib/AST/StmtOpenMP.cpp:128-129
+    llvm::function_ref<bool(unsigned, Stmt *)> Callback,
+    llvm::function_ref<bool(OMPLoopBasedDirective *)>
+        OnTransformationCallback) {
   CurStmt = CurStmt->IgnoreContainers();
----------------
ABataev wrote:
> Do we need `bool` return in the callback? I see that it returns `false` always.
I added it to be consistent with the other callback. Going to remove it.


================
Comment at: clang/lib/AST/StmtOpenMP.cpp:132-140
+    while (true) {
+      if (auto *Dir = dyn_cast<OMPTileDirective>(CurStmt)) {
+        if (OnTransformationCallback(Dir))
+          return false;
+        CurStmt = Dir->getTransformedStmt();
+        continue;
+      }
----------------
ABataev wrote:
> ```
> while (auto *Dir = dyn_cast<OMPTileDirective>(CurStmt)) {
>   if (OnTransformationCallback(Dir))
>     return false;
>   CurStmt = Dir->getTransformedStmt();
> }
> ```
With OMPUnrollDirective added, there are two conditions of the while loop. Of course, I can change the structure again with the unroll patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102180



More information about the cfe-commits mailing list