|
From: Patrick J. L. <lop...@gm...> - 2012-02-24 00:45:40
|
On Thu, Feb 23, 2012 at 12:17 AM, Julian Seward <js...@ac...> wrote: > > > Ultimately, I am looking for three things, in this order: > > > > 1) Eliminate false negatives for --partial-loads-ok=yes > > 2) Implement --partial-loads-ok=yes for SSE loads > > 3) Correctly propagate validity bits for PMOVMSKB > > Sounds sane. > > > It is turning out to be quite hard to eliminate Memcheck's false > > positives on my current code base (using the Intel compiler with full > > SSE4.2 optimization). > > What specific problems are you having? Mostly strlen(). Every time you call this function, the Intel compiler inlines a version that chops off the low bits of the address, loads 16 aligned bytes, and uses PCMPEQB + PMOVMSKB + BSF to see if the first null character of the string occurs in those 16 bytes. If not, it then calls an optimized strlen() function. (The optimized strlen() function is easily suppressed, but all the inlined code is much harder.) I say "mostly" because there are occasional warnings from __intel_memcpy() and such, and I have not examined the underlying assembly thoroughly. I have been steadily adding suppression rules based on instinct, but there are now so many that I am worried I may have silenced real problems. > In my uncommitted work on this, I added a new IROp > Iop_GetMSBs8x8, /* I64 -> I8 */ with behaviour [snip] > and used that to implement pmovmskb, rather than using a helper > function in the front end. This allows Memcheck to instrument it > exactly, since the same operation exactly describes the V bit > propagation. Back end then generates calls to this function > and that handles both the real computation and Memcheck's > instrumentation of it. LMK if you want the diff. I am definitely interested. I think this will add great value after we have (1) and (2). I am traveling this weekend, but I will take a first crack at (2) next week. Thanks. - Pat |