This is an archive of the discontinued LLVM Phabricator instance.

[mlir][openacc] Add shutdown operation
ClosedPublic

Authored by clementval on Sep 24 2020, 5:20 PM.

Details

Summary

This patch introduces the acc.shutdown operation that represents an OpenACC shutdown directive.
Clauses are derived from the spec 2.14.2

Diff Detail

Event Timeline

clementval created this revision.Sep 24 2020, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 24 2020, 5:20 PM
clementval requested review of this revision.Sep 24 2020, 5:20 PM
rriddle added inline comments.Sep 28 2020, 10:00 AM
mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
649

You can return the error directly. Also, you can use emitOpError to prefix the message with the op name.

Address review comments

mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
648

Would it be good to add an isComputeOperation function?

mlir/test/Dialect/OpenACC/invalid.mlir
71

Can you add a test where the check has to skip at least on level of parentOp before finding a compute operation?

Address review comment

clementval marked 2 inline comments as done.Sep 28 2020, 6:37 PM
clementval added inline comments.
mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
648

I added one since it will be shared with at least acc.init

ftynse added inline comments.Sep 29 2020, 4:59 AM
mlir/test/Dialect/OpenACC/invalid.mlir
1

Why do you need to allow unregistered dialects?

90

I'd rather use a dummy op with a generic syntax to avoid spurious test breakages if scf.if decides to change somehow.

clementval marked an inline comment as done.

Address review comments , rebase

ftynse accepted this revision.Sep 29 2020, 9:04 AM
This revision is now accepted and ready to land.Sep 29 2020, 9:04 AM
clementval marked 3 inline comments as done.Sep 29 2020, 10:12 AM
clementval added inline comments.
mlir/test/Dialect/OpenACC/invalid.mlir
1

I was plaining on using a dummy op and I now switched the scf.if with a dummy so now it is needed.

This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.
mehdi_amini added inline comments.Sep 29 2020, 11:53 AM
mlir/test/Dialect/OpenACC/invalid.mlir
1

Can we use a test op and avoid unregistered-dialect?
This makes the verifier a bit lose, which is undesirable for test I believe.

clementval added inline comments.Sep 29 2020, 12:18 PM
mlir/test/Dialect/OpenACC/invalid.mlir
1

Sure. Are there test op that we can use directly?

mehdi_amini added inline comments.Sep 29 2020, 12:42 PM
mlir/test/Dialect/OpenACC/invalid.mlir
1

You can looking the op definitions for the test dialect, but it also accept any unregistered op directly.
Using an op name after the test is likely "safe" (no one will register it in the test dialect later):

"test.openacc_dummy_op"() : () -> ()
clementval marked 2 inline comments as done.Sep 30 2020, 9:17 AM
clementval added inline comments.
mlir/test/Dialect/OpenACC/invalid.mlir
1

Ok, I'll send a patch today which will also remove the -allow-unregistered-dialect in the mlir/test/Dialect/OpenACC/ops.mlir tests.

1