This is an archive of the discontinued LLVM Phabricator instance.

[PPC] WIP - Add statistics for mem* fucntions
AbandonedPublic

Authored by sfertile on Feb 1 2017, 1:58 PM.

Details

Summary

Add Statistics for memset/memcpy/memmove/memcmp functions.

Counts the number of times one of these functions is lowered, and if the call has a know size at compile time. If the Call has a know size then we bucket the size into small/med/large.

For the intrinsics, the alignment of the arguments is checked and recorded if they have

  1. worst-case alignment
  2. ideal alignment

Finally I add an option that allows tuning the maximum number of memory-operatons done in a n expansion of memcpy/memset/memmove.

Diff Detail

Repository
rL LLVM

Event Timeline

sfertile created this revision.Feb 1 2017, 1:58 PM
inouehrs added inline comments.Feb 1 2017, 10:31 PM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
78

a small nit: memove -> memmove

119

Is if (Align % 16 == 0) better to support Align = 32, 64, ... ?

sfertile added inline comments.Feb 2 2017, 6:50 AM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
119

Your right, I'll change this to Align >= 16, I don't necessarily care that its exactly 16 byte aligned, rather I'm interested in it being at least 16 byte aligned.

sfertile updated this revision to Diff 86821.Feb 2 2017, 8:42 AM

Fixed some spelling mistakes.
Changed some of the stat descriptions so they are the same for each memory function.
Changed Aligned16 to check for at least 16 byte alignment rather than exactly 16 byte alignment.
Expanded the number of sizes tracked.

sfertile updated this revision to Diff 86880.Feb 2 2017, 2:09 PM

Changed some statistic descriptions, and expanded alignment stats to record 2, 4, 8 alignments as well.

sfertile updated this revision to Diff 87652.Feb 8 2017, 7:03 AM

rebased patch to top of trunk

sfertile abandoned this revision.Feb 27 2017, 11:40 AM