|
From: Julian S. <js...@ac...> - 2007-07-05 21:05:28
|
> The dst is the true dst and the fall through is the true fall through. Yes. There's nothing that mandates, for an IR Exit statement, that the fallthrough IR corresponds to the fallthrough guest instruction it was derived from. Various parts of the IR compilation pipeline switch around the sense of the exits from time to time. > Is this anyway around this problem? Has anyone written tool that > correctly identifies branchs? (And calls and returns.) Yes, Yes, and Not really. Reliably identifying all calls and returns is a very hard problem, and Josef W (Callgrind's author) is the person to ask. As far as the immediate problem goes: a couple months ago I extended cachegrind to do branch prediction simulation, and so had to solve this exact problem. It's not in the 3.2.X series but it is in the current trunk. svn co svn://svn.valgrind.org/valgrind/trunk and look at cg_main.c around line 1020, specifically the 'case Ist_Exit:' ... stuff. The branch events are fed through to the simulator in cg_branchpred.c. It probably has a fairly high level of bogosity. Comments, feedback, welcomed. J |