This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvmir] Simpler error handling in ConvertFromLLVMIR (nfc).
ClosedPublic

Authored by gysit on Oct 6 2022, 12:55 AM.

Details

Summary

The revision renames some methods of the Importer and changes
the error handling to be closer the ModuleTranslation. In particular,
processValue -> lookupValue and processType -> convertType
now fail if the translation fails (instead of returning an error),
which simplifies the error handling.

The revision prepares a follow up commit that will import
LLVMIR intrinsics using tablegen.

Diff Detail

Event Timeline

gysit created this revision.Oct 6 2022, 12:55 AM
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Oct 6 2022, 12:55 AM
ftynse accepted this revision.Oct 6 2022, 1:00 AM
ftynse added inline comments.
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
546–569

This part looks more than just "lookup". ..

This revision is now accepted and ready to land.Oct 6 2022, 1:00 AM
gysit updated this revision to Diff 465680.Oct 6 2022, 1:20 AM

Address comment.

mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
546–569

True it may be petter to keep the naming processValue / processValues an only rename once it is a lookup only.