Skip to content

Commit 0553a46

Browse files
committed
[MLIR][OpenMP] Update loop operations to use omp.loopnest
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.
1 parent 8226b47 commit 0553a46

File tree

5 files changed

+325
-187
lines changed

5 files changed

+325
-187
lines changed

mlir/include/mlir/Dialect/OpenMP/OpenMPInterfaces.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "mlir/Interfaces/ControlFlowInterfaces.h"
2222
#include "mlir/Interfaces/SideEffectInterfaces.h"
2323

24+
#define GET_OP_FWD_DEFINES
25+
#include "mlir/Dialect/OpenMP/OpenMPOps.h.inc"
26+
2427
#include "mlir/Dialect/OpenMP/OpenMPOpsInterfaces.h.inc"
2528

2629
namespace mlir::omp {

0 commit comments

Comments
 (0)