Previously for mem* intrinsics we only incremented the access count for
the first word in the range. However, after thinking it through I think
it makes more sense to record an access for every word in the range.
This better matches the behavior of inlined memory intrinsics, and also
allows better analysis of utilization at a future date.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 126647 Build 183990: arc lint + arc unit
Event Timeline
compiler-rt/test/memprof/TestCases/test_memintrin.cpp | ||
---|---|---|
40–42 | Fixed the size on these calls to what was intended, since I had to update the access counts anyway |
compiler-rt/test/memprof/TestCases/test_memintrin.cpp | ||
---|---|---|
8 | Update the count in the comments too? I was trying to reason about the counts here: |
lgtm
compiler-rt/test/memprof/TestCases/test_memintrin.cpp | ||
---|---|---|
8 | 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. |
compiler-rt/test/memprof/TestCases/test_memintrin.cpp | ||
---|---|---|
8 | 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 |
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?