This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Support llvm.readnone attribute for all FunctionOpInterface ops.
ClosedPublic

Authored by vzakhari on Aug 8 2022, 5:59 PM.

Details

Summary

The attribute is translated into LLVM's function attribute 'readnone'.
There is no explicit verification regarding conflicting 'readnone'
and function attributes from 'passthrough', though, LLVM would assert
if they are incompatible during LLVM IR creation.

Diff Detail

Event Timeline

vzakhari created this revision.Aug 8 2022, 5:59 PM
vzakhari requested review of this revision.Aug 8 2022, 5:59 PM

Friendly ping. Please review.

Can you add a test for the import case?

Can you add a test for the import case?

Sure! Can you please elaborate on what the "import case" is? :)

Import is llvm IR -> MLIR instead of MLIR->LLVM IR

Import is llvm IR -> MLIR instead of MLIR->LLVM IR

Got it! Thanks! I will add a new test in mlir/test/Target/LLVMIR/Import/.

Okay, so this requires extending the "importer" (ConvertFromLLVMIR.cpp). Does it make sense to implement it in this differential or it would be better to do it separately?

vzakhari updated this revision to Diff 453834.Aug 18 2022, 4:38 PM

Please let me know if I need to split the "importer" changes into a new differential. Otherwise, this should be ready for review. Thanks!

Thanks!

@ftynse ?

mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
932

Nit: remove spurious braces.

vzakhari updated this revision to Diff 454041.Aug 19 2022, 9:10 AM

Removed braces.

vzakhari marked an inline comment as done.Aug 22 2022, 5:05 PM

Kindly ping. Please review.

ftynse accepted this revision.Aug 24 2022, 3:46 AM
This revision is now accepted and ready to land.Aug 24 2022, 3:46 AM

Thank you all for the review!