This is a Work In Progress.
The patch define the OpenMP Canonical Operation for OpenMP MLIR Dialect
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
470 | Do we need LoopControlCanonical for canonical operation? The current is Fortran-style and may not exactly match the naive C/C++ for-stmt. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
462 | Depends on what is the value that is returned. What value are you expecting to return here? | |
473 | Try to reuse the same loop control unless you need a different one. You might also want to discuss whether the loop should unit step forward counting as in the OpenMP IRBuilder or general like in the current LoopControl. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
462 | @Meinersbur @kiranchandramohan My understanding is that the return result is an array of loop features that are OpenMP canonicalized. We can have ArrayAttr. We need Variadic because loop nesting can be variable. | |
473 | @Meinersbur Please see the comments for the increment. for (init-expr; test-expr; incr-expr) structured-block We can add an optional condition variable for this format in the LoopControl. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
438 | ||
473 | Personally, I would only make it take the trip count N with normalized %iv = 0...N-1 and let the Frontend handle all language semantics (is ub inclusive?, negative step, integer overflow, non-integer iteration variables, ...). It also simplifies mid-end passes since they only have to handle this normalized form. However, for omp.wsloop the Fortran people had strong opinion that we should represent lb/ub/step explicitly. IMHO it only makes the MLIR representation more complex. Apart from edge cases (lb=INT_MIN, ub=INT_MAX) it more expressive than the normalized way, so I am willing to compromise. |
@abidmalikwaterloo What is the plan here? Would @do or @Meinersbur be taking over this patch? Do you have a timeline?
@kiranchandramohan I am working on this with the help of @Meinersbur . I am aiming to wind up this ASAP.