[LLVMdev] Getting the DSNode from a Pool Descriptor?
simmon12 at illinois.edu
Fri Mar 19 09:56:08 CDT 2010
On 03/19/10 08:56, John Criswell wrote:
> Patrick Simmons wrote:
>> Thanks for all your help so far.
>> My problem is that what I have are the pool descriptors, which I by
>> traversing the uses of poolinit and accessing the first argument of
>> each call. I need to find the DSNode (in the original function) to
>> which this pool descriptor corresponds. The rub is that this pool
>> descriptor of course does not exist except in the clone.
> One way to do this might be to search for a use of the pool within the
> function (such as a poolalloc() or a function call that passes the
> pool). You can then find a pointer that belongs to the pool, map that
> pointer from the clone back to the original function, and then look up
> its DSNode.
> However, before you do that, can you tell us why you need this
> functionality? Since things are getting complicated, it may be
> worthwhile to first understand if your approach of mapping Pools to
> the DSNodes from which they were created is the correct approach for
> what you are doing. If, for example, you need to know whether a pool
> is a type-homogeneous, then an easier method would be to modify
> poolinit() to pass an argument containing DSNode information (such as
> a flag indicating type-homogeneity).
> -- John T.
I've thought of trying to do that, but that solution is really too ugly
to live. I need this because NSPASS (my project) runs after DSA but
before pool allocation and generates a list of DSNodes with a special
property. Then, TPPA (still my project) needs to iterate over every
pool, which it does by iterating over the uses of poolinit, and figure
out whether that pool needs to be annotated in a special way based on
whether the DSNode from whence it came had the special property. To do
this, it needs to convert the pool descriptor it gets by taking the
first argument of poolinit back into the DSNode it used to be and then
check the information from NSPASS to see whether it needs a special
Is there a better way to do this?
If I'm not here, I've gone out to find myself. If I get back before I return, please keep me here.
More information about the LLVMdev