This is an archive of the discontinued LLVM Phabricator instance.

[mlir-translate] More specific error message for BlockAddress
ClosedPublic

Authored by lafrance on Jan 23 2023, 2:11 AM.

Details

Summary

BlockAddress is currently unimplemented in the LLVM dialect of MLIR; when converting to LLVM dialect MLIR from LLVM IR, mlir-translate currently terminates with an "unhandled constant" error message. Instead, this message could be made more specific, to let the user know that the specific issue is that BlockAddress is unimplemented in the LLVM dialect.

First time contributor here so I'm happy to provide more detail or discussion if necessary -- wasn't sure how much to include for a change with such a simple implementation.

Diff Detail

Event Timeline

lafrance created this revision.Jan 23 2023, 2:11 AM
lafrance requested review of this revision.Jan 23 2023, 2:11 AM
lafrance edited the summary of this revision. (Show Details)Jan 23 2023, 2:14 AM
ftynse requested changes to this revision.Jan 23 2023, 3:40 AM

Thank you for the patch! Please reupload with more context info (https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface) and address the review.

mlir/lib/Target/LLVMIR/ModuleImport.cpp
1066–1067

Please add a test for any user-visible error message.

1068

This should return failure() rather than null (which will be interpreted as success).

This revision now requires changes to proceed.Jan 23 2023, 3:40 AM
lafrance updated this revision to Diff 491521.Jan 23 2023, 3:18 PM

@ftynse I saw that there was already a test that included blockaddress so I updated the error message there to provide coverage for the new message and changed my code to return a failure as it should; hopefully that should cover both comments in the review.

lafrance marked 2 inline comments as done.Jan 23 2023, 3:19 PM
lafrance updated this revision to Diff 491570.Jan 23 2023, 5:20 PM

Fixed formatting issues after changes introduced in the previous revision

ftynse accepted this revision.Jan 25 2023, 3:53 AM
This revision is now accepted and ready to land.Jan 25 2023, 3:53 AM
This revision was automatically updated to reflect the committed changes.