This is an archive of the discontinued LLVM Phabricator instance.

[flang][OpenMP] Support lowering to MLIR for ordered clause
ClosedPublic

Authored by peixin on May 12 2022, 2:23 AM.

Details

Summary

This supports the lowering parse-tree to MLIR for ordered clause in
worksharing-loop directive. Also add the test case for operation
conversion.

Part of this patch is from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>

Diff Detail

Event Timeline

peixin created this revision.May 12 2022, 2:23 AM
Herald added a project: Restricted Project. · View Herald Transcript
peixin requested review of this revision.May 12 2022, 2:23 AM

Thank you for the patch. Lowering side LGTM, with one question for the test case you have added. Please wait for someone else's comments for convert-to-llvmir.mlir test.

flang/test/Lower/OpenMP/omp-wsloop-ordered.f90
35

Is this ordered intentionally commented out?

LGTM. Have one comment. Also please respond to @NimishMishra's comments.

mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
70 ↗(On Diff #428885)

I think for clauses these conversion checks are not required in mlir.

You may add these tests in flang/test/Fir/convert-to-llvm-openmp-and-fir.fir

This revision is now accepted and ready to land.May 16 2022, 7:29 AM
peixin added inline comments.May 16 2022, 7:42 AM
flang/test/Lower/OpenMP/omp-wsloop-ordered.f90
35

Yes. It is not supported yet. I had one patch in fir-dev to support the lowering of ordered depend directive. But it may need changes since it must be consistent with OMPIRBuilder. Michael is working on the doacross loop nest support in OMPIRBuilder. After he supports it, I will take it back from fir-dev and fix it accordingly.

mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
70 ↗(On Diff #428885)

OK. The conversion for clauses does look like not necessary. I will remove this.

peixin updated this revision to Diff 429916.May 16 2022, 6:01 PM

Remove the mlir test case. Rebase before land.