Patrick Alexander Simmons
2009-Aug-07 22:03 UTC
[LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
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?). Thanks, --Patrick
John Criswell
2009-Aug-07 22:11 UTC
[LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
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 >
Patrick Alexander Simmons
2009-Aug-07 22:18 UTC
[LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
John Criswell wrote:> 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. >No, that's not it. This is happening before pool allocation has been run. It sounds like this is something that shouldn't be happening; I'll look into why it is. --Patrick
Maybe Matching Threads
- [LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
- [LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
- [LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
- [LLVMdev] DSA getNodeForValue() Returning NULL Sometimes
- [LLVMdev] DSA getNodeForValue() Returning NULL Sometimes