This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Add OpConvertPtrToU and OpConvertUToPtr Ops
ClosedPublic

Authored by mshahneo on May 22 2023, 3:17 AM.

Details

Summary

Add the definitions and necessary verifications of these Ops.

Diff Detail

Event Timeline

mshahneo created this revision.May 22 2023, 3:17 AM
Herald added a project: Restricted Project. · View Herald Transcript
mshahneo requested review of this revision.May 22 2023, 3:17 AM
antiagainst requested changes to this revision.May 23 2023, 11:08 AM
antiagainst retitled this revision from Add OpConvertPtrToU and OpConvertUToPtr Ops. to [mlir][spirv] Add OpConvertPtrToU and OpConvertUToPtr Ops.

Cool, thanks for adding these ops!

mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
1568

Nit: s/Result/result --- using lower case so it is consistent with other error messages.

Also applies to other cases.

1569

This op may not exist in a spirv::ModuleOp --- mlir allows mixing dialects and we can also have temporary situations during conversions that no wrapping spirv::ModuleOp exists. We should actually just return success() if no parent spirv::ModuleOp.

Similarly for the other op.

This revision now requires changes to proceed.May 23 2023, 11:10 AM
mshahneo updated this revision to Diff 525404.May 24 2023, 7:15 PM
mshahneo marked an inline comment as done.

Return success if the parent spirv::ModuleOp dose not exist.

Thank you so much, updated the revision.
Could you also please help me merge it, if it is accepted. I don't have merge permission.
Thanks in advance.

mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
1569

I see, thank you so much.

antiagainst accepted this revision.May 24 2023, 9:34 PM
This revision is now accepted and ready to land.May 24 2023, 9:34 PM
This revision was automatically updated to reflect the committed changes.