[PATCH][LAA] Fix estimation of number of memchecks

Silviu Baranga Silviu.Baranga at arm.com
Tue Jun 2 09:44:53 PDT 2015


Hi,

 

The attached patch fixes the estimation of the number of memchecks.

 

We need to add a runtime memcheck for pair of accesses (x,y) where at least
one of x and y

are writes.

 

Assuming we have w writes and r reads, currently this number is  estimated
as being

w* (w+r-1). This estimation will count (write,write) pairs twice and will
overestimate

the number of checks required.

 

The actual number of memchecks is (r + w - 1) + (r + w - 2) + .. + r which
is equal to

(w^2 + 2wr - w)/2.

 

The patch changes the formula and adds a small test.

 

Please review!

 

Thanks,

Silviu

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150602/1fca53d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: runtime.diff
Type: application/octet-stream
Size: 2715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150602/1fca53d2/attachment.obj>


More information about the llvm-commits mailing list