This is an archive of the discontinued LLVM Phabricator instance.

[mlir][LLVMIR] Parse some type attributes for LLVM function parameters
ClosedPublic

Authored by alexbatashev on Aug 22 2022, 3:29 AM.

Details

Summary

With the transition to opaque pointers, type information has been
transferred to function parameter attributes. This patch adds correct
parsing for some of those arguments and fixes some tests, that
previously used UnitAttr for those.

Diff Detail

Event Timeline

alexbatashev created this revision.Aug 22 2022, 3:29 AM
Herald added a project: Restricted Project. · View Herald Transcript
alexbatashev requested review of this revision.Aug 22 2022, 3:29 AM

Fix failures in Flang

Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 8:44 AM
ftynse requested changes to this revision.Aug 24 2022, 1:22 AM

Thanks!

mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
324

Nit: please expand auto unless the type is obvious from the line-level context.

329

Could we put the attr names in named constants somewhere in LLVMDialect.h? Ideally, we should also have a verifier for them in the dialect, but it may be out of scope for this patch.

mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
1200

Leftover debug.

1202

Ditto.

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
850–851

Could we please have a test for user-visible error messages?

This revision now requires changes to proceed.Aug 24 2022, 1:22 AM
vzakhari added inline comments.
mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
329

Some attributes' names are exposed via LLVMDialect::get* methods defined here.

Address reviewers' feedback

alexbatashev marked 6 inline comments as done.Aug 25 2022, 12:52 AM

Thanks

ftynse accepted this revision.Aug 25 2022, 12:53 AM
This revision is now accepted and ready to land.Aug 25 2022, 12:53 AM