This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add sret and byval argument attribute support to LLVM-IR dialect
ClosedPublic

Authored by schweitz on Jan 4 2021, 4:40 PM.

Details

Summary
Adds argument attributes for using LLVM's sret and byval attributes to
the conversion of LLVM IR dialect. These attributes are used in FIR to
support the lowering of Fortran using target-specific calling
conventions.

Add roundtrip tests.

Diff Detail

Event Timeline

schweitz created this revision.Jan 4 2021, 4:40 PM
schweitz requested review of this revision.Jan 4 2021, 4:40 PM
ftynse requested changes to this revision.Jan 5 2021, 2:45 AM

I have two requests:

  1. use UnitAttr instead of BoolAttr
  2. add tests for any user-visible error messages

(Potentially for a follow-up, we should check attributes in the op verifier, not in the translation, but I see there are other attributes checked in the translation).

This revision now requires changes to proceed.Jan 5 2021, 2:45 AM

I have two requests:

  1. use UnitAttr instead of BoolAttr
  2. add tests for any user-visible error messages

(Potentially for a follow-up, we should check attributes in the op verifier, not in the translation, but I see there are other attributes checked in the translation).

Sure. The use of BoolAttr was done to be consistent with the "noalias" attribute, fwiw.

schweitz updated this revision to Diff 314638.Jan 5 2021, 8:59 AM

Changes requested in review.

ftynse accepted this revision.Jan 5 2021, 9:00 AM
This revision is now accepted and ready to land.Jan 5 2021, 9:00 AM