This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Refactor translation of OpenMP dialect ops to LLVM IR
ClosedPublic

Authored by ftynse on Jan 5 2021, 7:04 AM.

Details

Summary

The original implementation of the OpenMP dialect to LLVM IR translation has
been relying on a stack of insertion points for delayed insertion of branch
instructions that correspond to terminator ops. This is an intrusive into
ModuleTranslation and makes the translation non-local. A recent addition of the
WsLoop translation exercised another approach where the parent op is
responsible for converting terminators of all blocks in its regions. Use this
approach for other OpenMP dialect operations with regions, remove the stack and
deduplicate the code for converting such regions.

Diff Detail

Event Timeline

ftynse created this revision.Jan 5 2021, 7:04 AM
ftynse requested review of this revision.Jan 5 2021, 7:04 AM
kiranchandramohan accepted this revision.Jan 6 2021, 3:21 PM

Thanks for this patch Alex. LGTM.

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
599

Nit: Can this comment be also moved to the refactored code?

This revision is now accepted and ready to land.Jan 6 2021, 3:21 PM
ftynse marked an inline comment as done.Jan 7 2021, 4:33 AM
ftynse added inline comments.
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
599

Will do before landing.

This revision was automatically updated to reflect the committed changes.
ftynse marked an inline comment as done.