================
@@ -227,11 +227,11 @@ void createHLFIRToFIRPassPipeline(mlir::PassManager &pm, 
bool enableOpenMP,
                                          hlfir::createOptimizedBufferization);
   }
   pm.addPass(hlfir::createLowerHLFIROrderedAssignments());
+  if (enableOpenMP)
+    pm.addPass(flangomp::createLowerWorkshare());
----------------
ivanradanov wrote:

I think we can use the code that lowers `hlfir.<intrinsic>` into openmp loops 
at the point the `hlfir.<intrinsic>`s are lowered into `fir.call`s into the 
flang rt library. We should have a check for whether we should use the generic 
lowering or the openmp loop lowering (using the `shouldUseWorkshareLowering` 
function) and then for the supported intrinsics lower it to openmp loops 
instead of the rt call.

Another option is to have another pass which runs before the pass that does the 
`fir.call` lowering and that pass takes care of the intrinsics we support.

Even if we use the first approach we should still probably have a separate 
compilation unit for the collection of those. This way it should not interfere 
much with the existing code and should be easy to integrate.

https://github.com/llvm/llvm-project/pull/113082
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to