Skip to content

Commit

Permalink
[MLIR][OpenMP] Update loop operations to use omp.loopnest
Browse files Browse the repository at this point in the history
This patch updates the definition of all OpenMP loop operations
(`omp.distribute`, `omp.parallel`, `omp.wsloop`, `omp.simdloop`,
`omp.taskloop`) to expect a nested `omp.loopnest` and act as wrapper operations
instead.

Loop information is removed from these operations and their list of traits is
updated to include a new common `LoopWrapperInterface`, as well as introducing
`SingleBlockImplicitTerminator` traits to all but `omp.parallel`, which can be
a wrapper in composite constructs but also define a regular code block.

These changes make it so wrapper operations can only have a single region and
block, and that it must only have a single compatible wrapper operation or
canonical loop in addition to a terminator.

Follow-up patches will update PFT to MLIR lowering to generate MLIR conforming
to these new definitions for loops.
  • Loading branch information
skatrak committed Mar 13, 2024
1 parent 8226b47 commit 0553a46
Show file tree
Hide file tree
Showing 5 changed files with 325 additions and 187 deletions.
3 changes: 3 additions & 0 deletions mlir/include/mlir/Dialect/OpenMP/OpenMPInterfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"

#define GET_OP_FWD_DEFINES
#include "mlir/Dialect/OpenMP/OpenMPOps.h.inc"

#include "mlir/Dialect/OpenMP/OpenMPOpsInterfaces.h.inc"

namespace mlir::omp {
Expand Down
Loading

0 comments on commit 0553a46

Please sign in to comment.