[llvm-dev] Finding all pointers to functions

Russell Wallace via llvm-dev llvm-dev at lists.llvm.org
Wed Dec 23 09:55:10 PST 2015


On Wed, Dec 23, 2015 at 5:35 PM, John Criswell <jtcriswel at gmail.com> wrote:

> DSA was built when LLVM's optimizations maintained the type information on
> GEP and other instructions (DSA existed before LLVM was open-source).  As
> such, it uses LLVM's type information to aid in its type-inference which,
> in turn, gives it field sensitivity which, in turn, improves its accuracy.
> Over time, LLVM optimizations have come to modify the type information so
> that it is just simple byte-level indexing (as opposed to
> array-of-structure indexing).  DSA hasn't been updated to handle that
> well.  That is why its precision is better pre-optimization than
> post-optimization.
>

Ah! I don't suppose you could point to some examples of this? E.g. a simple
test program such that one could eyeball the intermediate code before and
after optimization?

>
> Just out of curiosity, what are you trying to do?  I need call graph
> analysis for C/C++ code with function pointers, and so I'm writing an NSF
> proposal to seek funding to do that (among other enhancements to my SVA
> infrastructure).  If it's something that would be useful to you (or other
> LLVM community members), it would be useful for me to know that.
>

SVA?

I'm trying to write a superoptimizer that can optimize code based on a
high-level understanding of what it's actually doing, so yes, call graph
analysis that can deal with function pointers does seem likely to be one of
the things that will be needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151223/e63047aa/attachment.html>


More information about the llvm-dev mailing list