================ @@ -2590,13 +2590,27 @@ convertOmpWsloop(Operation &opInst, llvm::IRBuilderBase &builder, } builder.SetInsertPoint(*regionBlock, (*regionBlock)->begin()); + + bool noLoopMode = false; + omp::TargetOp targetOp = wsloopOp->getParentOfType<mlir::omp::TargetOp>(); + if (targetOp) { + Operation *targetCapturedOp = targetOp.getInnermostCapturedOmpOp(); ---------------- skatrak wrote:
Should we check here that the captured op is the `omp.loop_nest` wrapped by this `omp.wsloop`? The current implementation will set `noLoopMode = true` for both `omp.wsloop`s generated by this code: ```f90 !$omp target teams distribute parallel do do i=1,10 !$omp do do j=1,i end do end do ``` I'm not actually sure about what is the expected behavior of this, but I imagine that no-loop would just refer to the outer loop, as it's the one for which the trip count can be evaluated in the host. https://github.com/llvm/llvm-project/pull/155818 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits