This is an archive of the discontinued LLVM Phabricator instance.

[mlir][llvmir] Add support for llvm.signext/zeroext function attributes.
ClosedPublic

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

Details

Summary

This change-set adds basic support for llvm.signext and llvm.zeroext
attributes, and makes sure that the attributes are translated to LLVM IR
when attached to arguments.

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

Depends on D137047

Diff Detail

Event Timeline

vzakhari created this revision.Oct 30 2022, 2:07 PM
vzakhari requested review of this revision.Oct 30 2022, 2:07 PM
ftynse accepted this revision.Nov 2 2022, 6:40 AM
ftynse added inline comments.
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
992–1010

I see that this is just following the precedent, but could we rather do the verification in LLVM dialect? Dialects have a mechanism for verifying the attributes that use the namespace of the dialect.

mlir/test/Target/LLVMIR/llvmir-invalid.mlir
86

Nit: prefer @below to @+1

This revision is now accepted and ready to land.Nov 2 2022, 6:40 AM

Thank you for the review, Alex! I hope you do not mind that I move the verification code in a separate change-set.

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
992–1010

Yes, I know that this is a long-standing concern (e.g. https://reviews.llvm.org/D121948#inline-1166282). I am taking AR to move them all to LLVM dialect verification code in a separate change-set.

vzakhari updated this revision to Diff 472755.Nov 2 2022, 2:06 PM
vzakhari marked an inline comment as done.Nov 2 2022, 2:18 PM