This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][OpenMP] Unroll Construct operation
Needs RevisionPublic

Authored by abidmalikwaterloo on Jul 31 2022, 12:05 PM.

Details

Summary

The patch adds OpenMP unroll operation for the OMP dialect.

Diff Detail

Event Timeline

abidmalikwaterloo requested review of this revision.Jul 31 2022, 12:05 PM
abidmalikwaterloo retitled this revision from [MLIR][OpenMP] Unroll operation for the OMP dialect. to [MLIR][OpenMP] Unroll Construct operation.Jul 31 2022, 2:41 PM

I am not familiar with the MLIR tablegen format, but there might two issues:

  • The full clause does not have an operand, it is more similar to a flag like nowait.
  • The partial clauses operand is optional. $partial_operand is AnyInteger. Is there a sentinal value for $partial_operand if the clauses operand is omitted?
abidmalikwaterloo added a comment.EditedAug 2 2022, 4:04 PM

I am not familiar with the MLIR tablegen format, but there might two issues:

  • The full clause does not have an operand, it is more similar to a flag like nowait.

nowait is unitAtt. full can be treated the same way. I am considering it as boolean with 0 as false and 1 as true <

  • The partial clauses operand is optional. $partial_operand is AnyInteger. Is there a sentinal value for $partial_operand if the clauses operand is omitted?

Partial Clause has unroll factor which is an integer expression. There is no sentinal value, I think!

  • The full clause does not have an operand, it is more similar to a flag like nowait.

nowait is unitAtt. full can be treated the same way. I am considering it as boolean with 0 as false and 1 as true <

full(0) or full(1) feels clunkier than a flag. $full_operand is also an Optional, does it mean that full() is valid as well? Any reason to not also make it a unitAtt?

Partial Clause has unroll factor which is an integer expression. There is no sentinal value, I think!

I think I oversaw that it is an Optional<>, hence None would be that sentinel.

  • The full clause does not have an operand, it is more similar to a flag like nowait.

nowait is unitAtt. full can be treated the same way. I am considering it as boolean with 0 as false and 1 as true <

full(0) or full(1) feels clunkier than a flag. $full_operand is also an Optional, does it mean that full() is valid as well? Any reason to not also make it a unitAtt?

I will make it UnitAtt.

Partial Clause has unroll factor which is an integer expression. There is no sentinal value, I think!

I think I oversaw that it is an Optional<>, hence None would be that sentinel.

Ok. Will do and update the patch. accordingly

kiranchandramohan requested changes to this revision.Aug 14 2022, 2:13 PM

I think we should discuss this operation a bit more before proceeding. If the loop and its control are not part of the unroll OpenMP dialect operation then there is no guarantee that the unroll operation will happen. The loop can be modified or converted by other transformations or conversions.

This revision now requires changes to proceed.Aug 14 2022, 2:13 PM