This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvmir] Convert attributes for functions without bodies.
ClosedPublic

Authored by vzakhari on Oct 30 2022, 2:05 PM.

Details

Summary

So far the function argument attributes were only translated
for functions with bodies. This change makes sure that this
happens for functions without bodies (declarations) as well.

This is needed for https://github.com/llvm/llvm-project/issues/58579

Diff Detail

Event Timeline

vzakhari created this revision.Oct 30 2022, 2:05 PM
vzakhari requested review of this revision.Oct 30 2022, 2:05 PM
ftynse accepted this revision.Nov 2 2022, 6:39 AM
ftynse added inline comments.
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
897–899

Nit: can this use C++17-style structured bindings (aka tuple unpacking) in the loop instead?

This revision is now accepted and ready to land.Nov 2 2022, 6:39 AM
vzakhari added inline comments.Nov 2 2022, 1:36 PM
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
897–899

Thanks! Yes, we can use it. I will upload the updated file shortly (with a rebase - sorry for the inconvenience).

vzakhari updated this revision to Diff 472745.Nov 2 2022, 1:37 PM
vzakhari added inline comments.
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
832–833

Used structured binding here.

897

Used structured binding here.

Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 8:53 AM