[LLVMdev] Unused malloc/free don't get optimized

Vikram S. Adve vadve at uiuc.edu
Thu Feb 22 10:41:20 PST 2007

On Feb 22, 2007, at 10:21 AM, Robert L. Bocchino Jr. wrote:

> I glanced at the code again, and it looks like I use DSA to (1)  
> construct the call graph and (2) identify things that would be  
> unsafe to put on the stack, such as arrays, cyclic data structures,  
> and allocations with escaping references.  Right now these parts  
> are pretty heavily dependent on DSA -- e.g., they make explicit use  
> of the various DSA graphs.  I'm sure you could modify the code to  
> use AliasAnalysis instead of DSA, but I'm not sure what would be  
> involved in that.

Unfortunately, I don't think the AliasAnalysis interface gives a way  
to check whether allocations escape a function.  In DSA, you can do  
this because there is an explicit points-to graph: you can find all  
objects escaping "upwards" from a function by traversing the graph,  
starting at globals, formal arguments, and return values.


More information about the llvm-dev mailing list