This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add gpu.memcpy op.
ClosedPublic

Authored by csigg on Dec 14 2020, 1:24 AM.

Diff Detail

Event Timeline

csigg created this revision.Dec 14 2020, 1:24 AM
csigg requested review of this revision.Dec 14 2020, 1:24 AM
csigg updated this revision to Diff 311520.Dec 14 2020, 1:31 AM

Swap %src and %dst, doh.

herhut added inline comments.Dec 21 2020, 6:50 AM
mlir/include/mlir/Dialect/GPU/GPUOps.td
883

SameOperandsAndResultShape and SameOperandsAndResultElementType should make the custom verifier redundant.

901

This syntax is somewhat unprecedented, to have types intermixed with operands. I think I would prefer something like

gpu.memcpy %dst %src : type, type

We could be extra verbose and do

gpu.memcopy %src to %dst : type, type

csigg updated this revision to Diff 313177.Dec 21 2020, 12:29 PM

Change assembly syntax.
Improve verifier.

csigg added inline comments.Dec 21 2020, 12:31 PM
mlir/include/mlir/Dialect/GPU/GPUOps.td
883

That doesn't work because of the !gpu.async.token operands. I've stole the implementations from those verifiers though.

901

I changed it to gpu.memcpy %dst %src : type, type.

herhut accepted this revision.Dec 22 2020, 2:18 AM
herhut added inline comments.
mlir/include/mlir/Dialect/GPU/GPUOps.td
901

Hyper nit: Remove extra space in front of comma.

This revision is now accepted and ready to land.Dec 22 2020, 2:18 AM
csigg updated this revision to Diff 313356.Dec 22 2020, 8:39 AM

Remove space.

This revision was landed with ongoing or failed builds.Dec 22 2020, 8:40 AM
This revision was automatically updated to reflect the committed changes.