[llvm-branch-commits] [flang] [Flang][OMP] Replace SUM intrinsic call with SUM operations (PR #113082)
Ivan R. Ivanov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Oct 23 07:54:43 PDT 2024
================
@@ -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
More information about the llvm-branch-commits
mailing list