tblah wrote: > @kiranchandramohan @tblah @skatrak I have a question to people more familiar > with Fortran and the Flang pipeline - is it possible that we would have CFG > (multiple blocks) in the IR generated in the `omp.workshare` region at this > point in the pipeline (immediately after lowering HLFIR to FIR)? > > The transformation I implemented here can work with CFG but the > transformation _inlines_ the region contained in the `omp.workshare` region > in its parent op (while transforming it), which means that the parent op > would need to support multiple blocks, which is not a given (e.g. `fir.if`). > Is there an operation like `scf.execute` which can be used here to inline the > contents of the `omp.workshare` or should we not support CFG in this > transformation.
Yes we could have multiple blocks in cases where the control flow is not representable using our structured control flow operations. For example using CYCLE, EXIT or STOP statements. I think as a first pass it would be better not to support CFG, because this has been a frequent source of bugs in OpenMP lowering and will need to be tested carefully. I think the operation you are looking for might be `scf.execute_region`. https://github.com/llvm/llvm-project/pull/101446 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits