[LLVMdev] EQTDDataStructures omits obvious, direct callee from DSCallGraph

Andrew Lenharth andrewl at lenharth.org
Tue Aug 9 16:41:38 PDT 2011


On Tue, Aug 9, 2011 at 6:19 PM, Ben Liblit <liblit at cs.wisc.edu> wrote:
> I am using EQTDDataStructures (from the poolalloc project) to resolve
> indirect function calls to over-approximated sets of possible callees.

If I remember correctly, it only tries to resolve indirect calls.  The
analysis doesn't track direct calls because you can do it just as well
yourself.

Andrew

> Unfortunately I find that it yields incorrect results even on a very simple
> test input.  My LLVM and poolalloc sources are Subversion trunk checkouts,
> no more than a day older than the current trunk head.  My test input is the
> following C source, compiled to bitcode using Clang:
>
>        void foo();
>
>        void test()
>        {
>          foo();
>          foo();
>        }
>
> It should be rather obvious that each of the two call sites in test() must
> have exactly one callee: foo().  However, DSCallGraph reports *zero*
> possible callees at the first call site.  (It does correctly report foo() as
> the one possible callee at the second call site.)
>
> Why is the analysis getting this wrong?  Of course I am trying to build up
> to more complex, indirect calls.  But right now this very simple case has me
> stuck.
>
> Attached below is the complete source code for my pass which prints out the
> possible callees at each call site.  The important logic is at the end, in
> ShowCallGraph::runOnBasicBlock().  It seems simple enough.  Am I doing
> something wrong here?
>
> Thanks,
> Ben
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list