[LLVMdev] EQTDDataStructures omits obvious, direct callee from DSCallGraph

Ben Liblit liblit at cs.wisc.edu
Tue Aug 9 16:19:36 PDT 2011


I am using EQTDDataStructures (from the poolalloc project) to resolve 
indirect function calls to over-approximated sets of possible callees. 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ShowCallGraph.cpp
Type: text/x-c++src
Size: 1404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110809/8286eed9/attachment.cpp>


More information about the llvm-dev mailing list