[PATCH] D69922: [OpenMP] Use the OpenMP-IR-Builder

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 10:52:37 PST 2019


ABataev added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:3489
+        OMPRegionInfo->hasCancel()) {
+      auto IP = CGF.Builder.saveIP();
+      llvm::BasicBlock *ExitBB =
----------------
Also, you need to introduce/use RAII that saves/restores insertion point automatically.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:3492
+          CGF.createBasicBlock(".cancel.exit", IP.getBlock()->getParent());
+      OMPBuilder->setCancellationBlock(ExitBB);
+      CGF.Builder.SetInsertPoint(ExitBB);
----------------
Maybe, instead of saving the state, pass the pointer to the cancel block as a parameter to the `CreateBarrier` function?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69922





More information about the llvm-commits mailing list