This is an archive of the discontinued LLVM Phabricator instance.

[libc] automemcpy
ClosedPublic

Authored by gchatelet on Oct 14 2021, 6:19 AM.

Details

Reviewers
courbet
gchatelet
Summary

"automemcpy: A framework for automatic generation of fundamental memory operations"
https://research.google/pubs/pub50338/

This patch implements the concepts presented in the paper, the overall approach is the following:

  • Makes use of constraint programming to model the implementation of a memory function (memcpy, memset, memcmp, bzero, bcmp).
  • Generate the code for all valid implementations
  • Compile the implementations and benchmark them on a set of machines. The benchmark makes use of representative distributions for the function's arguments.
  • Analyze the result and pick "the best" performing function according to the specific environment.

This is the patch to be submitted but since it is quite big to review, it is split into several sub-patches:

Once all of them are accepted we can submit this one.

Diff Detail

Event Timeline

gchatelet created this revision.Oct 14 2021, 6:19 AM
gchatelet requested review of this revision.Oct 14 2021, 6:19 AM
gchatelet updated this revision to Diff 380000.Oct 15 2021, 7:28 AM
  • Address function generator comments
  • Address comments for codegen
gchatelet updated this revision to Diff 380645.Oct 19 2021, 4:33 AM
  • Fix typo
gchatelet updated this revision to Diff 382971.Oct 28 2021, 2:53 AM
  • [libc] automemcpy
  • Add documentation, unify three maps as a single one.
  • Add tests for result analyzer
  • Address comments
  • Address comments
gchatelet accepted this revision.Oct 28 2021, 3:53 AM

This patch has been accepted though these patches:

  • D111624 [libc] automemcpy - result analyzer
  • D111622 [libc] automemcpy - codegen
  • D111621 [libc] automemcpy - function generator
  • D111554 [libc] automemcpy README and main include file

I will land it shortly.

This revision is now accepted and ready to land.Oct 28 2021, 3:53 AM