[clang] [CIR][OpenMP] Add support for combined target parallel directives (PR #207019)

Jan Leyonberg via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 28 10:05:34 PDT 2026


================
@@ -48,29 +70,35 @@ CIRGenFunction::emitOMPParallelDirective(const OMPParallelDirective &s) {
 
   auto parallelOp = mlir::omp::ParallelOp::create(builder, begin, clauseOps);
 
-  {
-    mlir::Block &block = parallelOp.getRegion().emplaceBlock();
-    mlir::OpBuilder::InsertionGuard guardCase(builder);
-    builder.setInsertionPointToEnd(&block);
+  mlir::Block &block = parallelOp.getRegion().emplaceBlock();
+  mlir::OpBuilder::InsertionGuard guard(builder);
+  builder.setInsertionPointToEnd(&block);
 
-    LexicalScope ls{*this, begin, builder.getInsertionBlock()};
+  CIRGenFunction::LexicalScope ls{cgf, begin, builder.getInsertionBlock()};
+
+  if (s.hasCancel())
+    cgm.errorNYI(s.getBeginLoc(), "OpenMP Parallel with Cancel");
----------------
jsjodin wrote:

Yes, the emitNYI returns something useful now that can be checked.

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


More information about the cfe-commits mailing list