[LLVMdev] DSA getNodeForValue() Returning NULL Sometimes

John Criswell criswell at cs.uiuc.edu
Fri Aug 7 15:11:02 PDT 2009


Patrick Alexander Simmons wrote:
> Andrew Lenharth wrote:
>   
>> On Fri, Aug 7, 2009 at 4:45 PM, Patrick Alexander
>> Simmons<simmon12 at cs.uiuc.edu> wrote:
>>   
>>     
>>> I'm iterating over all LoadInst and StoreInst-type Instructions in a
>>> Function, and getNodeForValue() is sometimes returning NULL.  Why is
>>> this happening?  Shouldn't every load from or store to memory correspond
>>> to some DSNode?
>>>     
>>>       
>> Not if the pointer is null or the pointer contains no information in
>> the pass you are querying.
>>
>> Andrew
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>   
>>     
>
> The program I'm analyzing is not dereferencing NULL pointers.  I'm 
> querying the EquivBUDataStructures pass; what instances would cause the 
> DSGraph not to have any information about the pointer (and I thought 
> Unknown DSNodes were created for when we couldn't figure out the pointer 
> value?).
>   
You can sometimes get NULL DSNodes if a previously-run transform pass
adds pointers to the program but doesn't update DSA while claiming to
preserve it.  The pool allocation pass, for example, does this: it
claims to preserve the DSA results (when used for SAFECode) but doesn't
properly update the DSGraph when it adds pool handles.  Therefore, if
you try to get the DSNode of a Pool Handle pointer, you get a NULL DSNode.

I don't know if this is what you're seeing, but it's a potential reason.

-- John T.

> Thanks,
> --Patrick
> _______________________________________________
> 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