This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvm] Modernize the import of LLVM IR globals.
ClosedPublic

Authored by gysit on Jan 4 2023, 2:40 AM.

Details

Summary

Return failure if the import of a global variable fails and add a
test case to check the emitted error message. Additionally, convert
the globals in iteration order and do not process them recursively
when translating a constant expression referencing it. Additionally,
use the module location rather unknown location.

Diff Detail

Event Timeline

gysit created this revision.Jan 4 2023, 2:40 AM
Herald added a project: Restricted Project. · View Herald Transcript
gysit requested review of this revision.Jan 4 2023, 2:40 AM
Dinistro accepted this revision.Jan 4 2023, 7:10 AM

LGTM module the unnecessary global mapping.

mlir/include/mlir/Target/LLVMIR/ModuleImport.h
116–128

I think we do not need this mapping at this point. Other globals are reference with the symbol name.

249–250

As above

This revision is now accepted and ready to land.Jan 4 2023, 7:10 AM
gysit updated this revision to Diff 486287.Jan 4 2023, 7:30 AM

Address review comments.

This revision was landed with ongoing or failed builds.Jan 4 2023, 8:15 AM
This revision was automatically updated to reflect the committed changes.