<div dir="ltr">Yes i agree, so for the data dependencies through pointers, i first use inter-procedure alias analysis to find the alias pointer sets, and set up dependency between those store/load instructions whose memory locations are aliases. <div><br></div><div>The reason I want to exactly know point-to level is, for a function with multi-level pointer as arguments, like func(int ***p), i hope to demonstrate the memory read/write process for each level on my graph, if necessary i will add some dummy nodes to represent the intermediate memory read/write. </div><div><br></div><div>Best regards,</div><div><br></div><div>Shen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 10:48 PM, Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Points-to level does not tell you much.<br>
<br>
It is entirely possible for the relationship to go in the wrong direction.<br>
LLVM does not say it is illegal :)<br>
<br>
(IE it does not say that int *** can only point to int **)<br>
<span class=""><br>
<br>
<br>
On Fri, Jul 17, 2015 at 6:32 PM, Shen Liu <<a href="mailto:shl413@lehigh.edu">shl413@lehigh.edu</a>> wrote:<br>
> John, thanks for your helpful advice.<br>
><br>
> My ultimate goal is to construct a full instruction-level program dependence<br>
> graph for a given IR file. The hard point is how to establish the correct<br>
> data dependence edges when some function arguments are multi-level pointers.<br>
> To solve this problem I hope to check the point-to level for each pointer<br>
> variable. I think the data dependence through pointers can be described more<br>
> accurately in this way. Unfortunately i didn't find any available interface<br>
> to finish this job, so i guess i have to write it by myself.<br>
><br>
> Best regards,<br>
><br>
> Shen<br>
><br>
><br>
><br>
</span><span class="">> On Fri, Jul 17, 2015 at 2:22 PM, John Criswell <<a href="mailto:jtcriswel@gmail.com">jtcriswel@gmail.com</a>> wrote:<br>
>><br>
>> On 7/17/15 1:06 PM, Shen Liu wrote:<br>
>><br>
>>  John, thanks for you answer! But as far as I know LLVM doesn't provide<br>
>> any interface for finding the pointee of a pointer directly, so i have to<br>
>> process a multi-level pointer i need to write my own function to check<br>
>> pointers level by level, is that right?<br>
>><br>
>><br>
>> I'm not sure what you're trying to do.  If you're trying to determine the<br>
>> LLVM pointer type and the LLVM type to which it points, what I've said will<br>
>> work.<br>
>><br>
>> If you're trying to do something more complicated, then you need to<br>
>> explain more clearly what you want to do.  I think it would also help if you<br>
>> "jumped up a level" and explained what your end goal is so that the<br>
>> community can give you better advice.  Based on your previous emails, it<br>
>> seems like you're asking very specific questions instead of asking how to<br>
>> best achieve your overall goal.<br>
>><br>
>> Regards,<br>
>><br>
>> John Criswell<br>
>><br>
>><br>
>><br>
</span>>> On Fri, Jul 17, 2015 at 1:47 PM, John Criswell <<a href="mailto:jtcriswel@gmail.com">jtcriswel@gmail.com</a>><br>
<span class="">>> wrote:<br>
>>><br>
>>> On 7/17/15 12:38 PM, Shen Liu wrote:<br>
>>><br>
>>> Hi all, as a LLVM beginner I would like to know how can i check the<br>
>>> pointer types with different levels like int 32* and int 32**, int 32***?<br>
>>><br>
>>> By using value->getType()->isPointerTy() i can just know they are<br>
>>> pointers. But the dump results clearly show they are different. Is there a<br>
>>> good way to calculate their actual point to levels? Thanks!<br>
>>><br>
>>><br>
>>> You will need to use dyn_cast<PointerType> to cast the Type * into a<br>
>>> PointerType *.  Once you do that, you can find the Type * that the<br>
>>> PointerType points to.<br>
>>><br>
>>> Regards,<br>
>>><br>
>>> John Criswell<br>
>>><br>
>>><br>
>>><br>
>>> Best regards,<br>
>>><br>
>>> Shen<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> LLVM Developers mailing list<br>
</span>>>> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<span class="">>>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> John Criswell<br>
>>> Assistant Professor<br>
>>> Department of Computer Science, University of Rochester<br>
>>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=PpDyGx2_OZwL3w8sjO4OlJGRTzpr3SuqbRk56PFIp6c&s=lbGylPiCnXwvuREtGN7_hLkqwlSvwe65QN2MrET58nE&e=" rel="noreferrer" target="_blank">http://www.cs.rochester.edu/u/criswell</a><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> John Criswell<br>
>> Assistant Professor<br>
>> Department of Computer Science, University of Rochester<br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=PpDyGx2_OZwL3w8sjO4OlJGRTzpr3SuqbRk56PFIp6c&s=lbGylPiCnXwvuREtGN7_hLkqwlSvwe65QN2MrET58nE&e=" rel="noreferrer" target="_blank">http://www.cs.rochester.edu/u/criswell</a><br>
><br>
><br>
><br>
</span><span class="">> _______________________________________________<br>
> LLVM Developers mailing list<br>
</span>> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
</blockquote></div><br></div>