This is an archive of the discontinued LLVM Phabricator instance.

[mlir:llvm] Pass arguments attributes to LLVM function arguments
AbandonedPublic

Authored by ezhulenev on Aug 16 2022, 12:21 PM.

Details

Reviewers
ftynse
dcaballe

Diff Detail

Event Timeline

ezhulenev created this revision.Aug 16 2022, 12:21 PM
ezhulenev requested review of this revision.Aug 16 2022, 12:21 PM

Please keep in mind that "passthrough" is a terrible hack primarily intended for discovering which attributes are must model first. We should be adding proper modeling for most of them, but there are just too many. Specifically, we already have inalloca, noalias and sret that are relevant for pointers, we can easily add nocapture if this is what you actually need.

mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
2343–2344

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

2346

Ultra-nit: emitOpError prints the message of the style foo.bar op <your-message>, which would doesn't read well with this message, using emitError instead will just print <your-message>. Both are still emitted at the location of the op. Alternatively, rephrase the error message to start with "expects" so the whole text is `foo.bar op expects attribute to be an array".

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
765
ezhulenev abandoned this revision.Sep 1 2022, 1:35 PM

I'll abandon it in favor of proper modeling of nocapture