[LLVMdev] incorrect DSCallGraph for simple indirect call with vtable nearby
Ben Liblit
liblit at cs.wisc.edu
Thu Aug 11 08:40:32 PDT 2011
Will Dietz wrote:
> This is actually the expected behavior for EQTD :).
Expected by you, maybe. :-D
> If you switch to TD you'll get better alias-analysis information, and
> in this example the correct result.
OK, I have switched to TDDataStructures as well, and I am also seeing
much better (for my purposes) results in simple tests. I'll keep poking
at this some more and let you folks know if I hit any other surprises.
There is no mention of TDDataStructures in
"poolalloc/dsa-manual/manual.tex", which is why I did not consider using
it earlier. Can you give me a high-level idea of how TDDataStructures
and EQTDDataStructures differ? Clearly they differ in the "gives the
answers Ben expected" dimension, but that's not a very useful
description more generally. What should I know about the key
differences between these two?
> FWIW at the moment DSA doesn't give good results for vtable-heavy
> code, marking all such callsites as incomplete and cannot resolve
> them.
Understood. My plan for vtable-based calls is to pattern-match on the
specific code sequences emitted by clang or whatever front end we are
using. Likewise I'll be exploiting C++ domain knowledge to recognize
global variables that are vtables. Once the clang type-system-rewrite
work is released, that will also help me a lot as I'll have better
information about the static types at each vtable call site. So I think
I'm in reasonable shape for vtables. [I was prepared to be pleasantly
surprised if DSA figured these out for me, but I certainly was not
expecting or assuming that.]
Thanks again, Will, John, and Andrew. You've been most helpful. It's
great to see that the high quality of LLVM's code is matched by the high
quality of support found on this mailing list.
Regards,
Ben
More information about the llvm-dev
mailing list