This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Add block read and write from SPV_INTEL_subgroups
ClosedPublic

Authored by abialas on Aug 31 2020, 6:26 AM.

Details

Summary

Added support to OpSubgroupBlockReadINTEL and OpSubgroupBlockWriteINTEL

Diff Detail

Event Timeline

abialas created this revision.Aug 31 2020, 6:26 AM
abialas requested review of this revision.Aug 31 2020, 6:26 AM
abialas updated this revision to Diff 289143.Sep 1 2020, 5:41 AM
antiagainst accepted this revision.Sep 1 2020, 10:06 AM

Nice, thanks!

This revision is now accepted and ready to land.Sep 1 2020, 10:06 AM
ThomasRaoux added inline comments.Sep 1 2020, 9:58 PM
mlir/include/mlir/Dialect/SPIRV/SPIRVGroupOps.td
228

Are you missing the buffer type? (ex: "StorageBuffer")

mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
2056

The description mentions:

Result Type may be a scalar or vector type, and its component type must be
equal to the type pointed to by Ptr.

The type of Ptr must be a pointer type, and must point to a scalar type.

Here it looks like if the data is a vector we would expect the pointer to be a pointer of elementType which would be a pointer of vector.

2074–2077

Same problem as above here, this verification function would check that pointer points to a type matching the destination type. This is consistent with the parser but not with the description.

It might be worth adding a test for the vector case to make sure you have what you want.

abialas updated this revision to Diff 289390.Sep 2 2020, 4:01 AM

added changes from code review

Thanks Thomas, good catch. Please take a look at the updated version. If it looks good, may I ask you to push this change to llvm master?

ThomasRaoux accepted this revision.Sep 2 2020, 7:50 PM

Thanks Thomas, good catch. Please take a look at the updated version. If it looks good, may I ask you to push this change to llvm master?

Sure, this is done.