Arushi Aggarwal
2010-Dec-13 19:20 UTC
[LLVMdev] How can I determine safely if a CallSite is "live" in a DSGraphs context
Hi, I believe shouldHaveNodeForValue() should return false for ConstantPointerNullValue. Fixed in r121707. Arushi On Mon, Dec 13, 2010 at 12:10 PM, Kevin Streit <kevin.streit at googlemail.com>wrote:> I'm using BUDataStructures... But I tried LocalDatastructures and it didn't > work either... > On Dec 13, 2010 6:52 PM, "Arushi Aggarwal" <arushi987 at gmail.com> wrote: > > Hi, > > > > Which DSA pass are you using, local/bu/td? I can try looking at this once > I > > know that. > > > > Arushi > > > > > > On Mon, Dec 13, 2010 at 11:26 AM, Kevin Streit > > <kevin.streit at googlemail.com>wrote: > > > >> Hi, > >> > >> I'm using DSAnalysis in order to get some points to information. In my > >> particular case for a CallSite. > >> Everything is working well except for some special cases. Consider the > >> following example code: > >> > >> // =====================> >> > >> void m(short *s) { > >> return; > >> } > >> > >> int main() { > >> m(0); > >> } > >> > >> // =====================> >> > >> The call to method m in the main method is translated to "call void > @m(i16* > >> null) nounwind ssp". > >> If I try to call getDSCallSiteForCallSite(...) with the above mentioned > >> CallSite as argument on the DSGraph of the main method I get a failing > >> assertion when the getDSCallSiteForCallSite method tries to get the > DSNode > >> (via getNodeForValue(...)) for the "i16* null" argument. So it obviously > >> thinks it should have a node for that value (since > >> shouldHaveNodeForValue(i16* null) returns true) and thus calls > >> getNodeForValue, which raises the error (The node is not contained in > the > >> ScalarMap). > >> > >> I tried to verify if I'm using the analysis correctly by invoking the > >> poolalloc tool on the program which raises a completely different error. > >> > >> So under which circumstances is it safe to call > getDSCallSiteForCallSite? > >> > >> Or stated otherwise: Should shouldHaveNodeForValue() return true for a > >> ConstantPointerNullValue? > >> > >> Thanks, Kevin > >> > >> > >> _______________________________________________ > >> LLVM Developers mailing list > >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >> > >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101213/da9dbf33/attachment.html>
Kevin Streit
2010-Dec-13 19:42 UTC
[LLVMdev] How can I determine safely if a CallSite is "live" in a DSGraphs context
Yeah. That was my guess (and workaround fix) too. Thanks for the quick reply. I just wonder that this didn't occur more often since it seems like a common situation to me to pass a constant zero pointer argument. Anyway, thanks again. On Dec 13, 2010 8:21 PM, "Arushi Aggarwal" <arushi987 at gmail.com> wrote:> Hi, > > I believe shouldHaveNodeForValue() should return false for > ConstantPointerNullValue. > > Fixed in r121707. > > Arushi > > > On Mon, Dec 13, 2010 at 12:10 PM, Kevin Streit > <kevin.streit at googlemail.com>wrote: > >> I'm using BUDataStructures... But I tried LocalDatastructures and itdidn't>> work either... >> On Dec 13, 2010 6:52 PM, "Arushi Aggarwal" <arushi987 at gmail.com> wrote: >> > Hi, >> > >> > Which DSA pass are you using, local/bu/td? I can try looking at thisonce>> I >> > know that. >> > >> > Arushi >> > >> > >> > On Mon, Dec 13, 2010 at 11:26 AM, Kevin Streit >> > <kevin.streit at googlemail.com>wrote: >> > >> >> Hi, >> >> >> >> I'm using DSAnalysis in order to get some points to information. In my >> >> particular case for a CallSite. >> >> Everything is working well except for some special cases. Consider the >> >> following example code: >> >> >> >> // =====================>> >> >> >> void m(short *s) { >> >> return; >> >> } >> >> >> >> int main() { >> >> m(0); >> >> } >> >> >> >> // =====================>> >> >> >> The call to method m in the main method is translated to "call void >> @m(i16* >> >> null) nounwind ssp". >> >> If I try to call getDSCallSiteForCallSite(...) with the abovementioned>> >> CallSite as argument on the DSGraph of the main method I get a failing >> >> assertion when the getDSCallSiteForCallSite method tries to get the >> DSNode >> >> (via getNodeForValue(...)) for the "i16* null" argument. So itobviously>> >> thinks it should have a node for that value (since >> >> shouldHaveNodeForValue(i16* null) returns true) and thus calls >> >> getNodeForValue, which raises the error (The node is not contained in >> the >> >> ScalarMap). >> >> >> >> I tried to verify if I'm using the analysis correctly by invoking the >> >> poolalloc tool on the program which raises a completely differenterror.>> >> >> >> So under which circumstances is it safe to call >> getDSCallSiteForCallSite? >> >> >> >> Or stated otherwise: Should shouldHaveNodeForValue() return true for a >> >> ConstantPointerNullValue? >> >> >> >> Thanks, Kevin >> >> >> >> >> >> _______________________________________________ >> >> LLVM Developers mailing list >> >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >> >> >>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101213/a65a118b/attachment.html>