This is an archive of the discontinued LLVM Phabricator instance.

[mlir][openacc] Update acc.loop to be a proper loop like operation
ClosedPublic

Authored by clementval on Aug 30 2023, 2:22 PM.

Details

Summary

The initial design of the acc.loop was to be an operation that encapsulates
a loop like operation. This was an early design and we now want to change it
so the acc.loop operation becomes a real loop-like operation by implementing
the LoopLikeInterface.

Note that flang lowering will fail with this new design and a patch to update the lowering will be posted alongside this one.

Diff Detail

Event Timeline

clementval created this revision.Aug 30 2023, 2:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 30 2023, 2:22 PM
clementval requested review of this revision.Aug 30 2023, 2:22 PM
clementval edited the summary of this revision. (Show Details)Aug 30 2023, 2:23 PM

Update example and lit tests for collapse case

razvanlupusoru accepted this revision.Aug 31 2023, 9:04 AM

Looks great to me!

mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
1142

The source language may have both inclusive and exclusive upper bounds - so in a multiple loop scenario I am not sure if a single attribute will be enough.

This revision is now accepted and ready to land.Aug 31 2023, 9:04 AM
clementval added inline comments.Aug 31 2023, 11:02 AM
mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
1142

I'm gonna update this with a DenseBoolArrayAttr so we can have a vlue for each "loop".

Switch inclusiveUpperbound to DenseBoolArrayAttr

razvanlupusoru accepted this revision.Sep 6 2023, 12:25 PM

Make range optional