================
@@ -101,10 +102,32 @@ emitParallelOp(CIRGenFunction &cgf, const DirectiveTy &s,
"reduction(task: ...) should already be rejected as NYI");
mlir::LogicalResult res = emitBody();
+ ls.forceCleanup();
----------------
jsjodin wrote:
Scoping ls doesn't quite work: when a LexicalScope is destroyed it terminates
the block with a cir.yield, which isn't valid inside an OpenMP region.
forceCleanup() runs the cleanups without adding a terminator, so we can add the
omp.terminator ourselves. To make it hard to forget, I moved the scope,
forceCleanup() and terminator into one helper, emitOMPRegionBody, which all the
OpenMP region ops can use.
https://github.com/llvm/llvm-project/pull/229256
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits