[PATCH] D110799: [MemProf] Record accesses for all words touched in mem intrinsic

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 30 15:05:51 PDT 2021


tejohnson added inline comments.


================
Comment at: compiler-rt/test/memprof/TestCases/test_memintrin.cpp:8
 //   alloc_count 1, size (ave/min/max) 40.00 / 40 / 40
 //   access_count (ave/min/max): 3.00 / 3 / 3
 // but we need to look for them in the same CHECK to get the correct STACKIDP.
----------------
snehasish wrote:
> snehasish wrote:
> > Update the count in the comments too?
> > 
> > I was trying to reason about the counts here: 
> > For the first allocation for p = new int[10] - the allocation itself counts as 1 + memset counts for 5 (since kWordSize = 8). How do we account for the remaining 5 since the memcpy and memcmp have 2 full words and 1 half word access?
> I guess since this is a primitive, the allocation and deallocation don't have accesses and thus the number of accesses is 5 + 3 + 3, rounding up for the half word accesses since the check is addr+size on L269.
Yep, the sizes are effectively rounded up by the traversal in __memprof_record_access_range, and as you noted there is no access on allocation, so the 5 +3 + 3 is correct.

Will fix the comments


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110799/new/

https://reviews.llvm.org/D110799



More information about the llvm-commits mailing list