This patch adds tasking construct according to Section 2.10.1 of OpenMP 5.0
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
63 |
| |
521 | nit: I32 -> I64 |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
63 | The depend clause for the task construct is going through a revision in the language committee. One should go through the proposed revision before defining it. |
Addressed comments.
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
63 | Yes, thank you for pointing this out. I was planning to do this later but forgot to undo the move. | |
515 | A boolean value is an I1. Are you referring to UnitAttr? It cannot be used here because the value of UnitAttr is a compile-time constant but here it is a value at runtime. | |
521 | I kept it I32 because the task related runtime functions accept i32 as priority values. Allowing an I64 value as priority here and having a INT64_MAX as priority might lead to unexpected behavior due to data loss during translation. |
LGTM. Please wait for at least one more approve befire land.
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
63 | Right. OpenMP 5.2 made great changes to depend clause. But I think we should support OpenMP 5.0/5.1 since there are some old workloads using them. We can delay the support of new features from OpenMP 5.2. Finally, we should support both of new depend clause in OpenMP 5.2 and old depend clause before OpenMP 5.1. | |
521 | OK. I didn't check the runtime argument type. I32 is right. | |
mlir/test/Dialect/OpenMP/ops.mlir | ||
1015 | Nit: split the test case with "// -----" |
mlir/test/Dialect/OpenMP/ops.mlir | ||
---|---|---|
1015 | With the verifier, I needed the symbol @add_f32 in scope. So, I moved the testcase above which gives me access to the symbol. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
470 | Can you add the OutlineableAopenMPOpInterface and the AutomaticAllocationScope? What about the ReductionClauseInterface? |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
470 | I do not see anything using the OutlineableOpenMPOpInterface. Plus its description also seems to be incomplete. I understand what kind of operations will have this interface, but is something actually using it? |
LGTM.
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
470 | At the moment, it is used to find a place to insert allocas in flang/lib/Optimizer/Builder/FIRBuilder.cpp and also to check whether allocas should be marked as pinned. |
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
470 | Alright. Thank you for the details. |