This is an archive of the discontinued LLVM Phabricator instance.

[flang][RFC][WIP} Inline sum - not ready to use
Needs ReviewPublic

Authored by Leporacanthicus on Apr 14 2022, 5:54 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is not a finished implementation, it is mostly "to encourage
discussion", not intended to be reviewed in detail, more as a "this
is how this could be done".

Known issues:

  • Only supports sum, although where it is implemented will also be

called for the PRODUCT intrinsic.

  • It doesn't support all types.
  • Only supports one dimensional arrays. There's nothing

stopping this from being multi-dimensional, just more code
needed.

  • Need specific tests for "does it inline" or "should not inline".
  • Need a way to disable this feature.

I'm sure there are OTHER issues too.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 14 2022, 5:54 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
Leporacanthicus requested review of this revision.Apr 14 2022, 5:54 AM
Leporacanthicus retitled this revision from [flang][RFC] Inline sum - not ready to use to [flang][RFC][WIP} Inline sum - not ready to use.Apr 14 2022, 5:58 AM
Leporacanthicus removed a project: Restricted Project.
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 5:58 AM
peixin added a subscriber: peixin.Jun 18 2022, 3:19 AM

We may need one option like -finline-intrinsic={value}, in which the value can be one intrinsic name or all, or some kind(several intrinsic functions with similar feature). I tried to inline some functions in classic flang, but it did not give higher performance in all cases.