<div dir="auto">Hi David,<div dir="auto">I think it should be a feasible solution. I'll make some experiment soon.</div><div dir="auto"><br></div><div dir="auto">If tutorials for this topic are not available it would be great to have them.</div><div dir="auto"><br></div><div dir="auto">Thanks a lot for your help</div><div dir="auto">Alberto</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 9, 2019, 12:51 David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If you're not worried about the mapping to C parameters, then you should <br>
be able to start with the SSA values for the parameters and then walk <br>
the def-use chains to find everything that depends on it (modulo things <br>
that depend on it as a result of control flow or memory stores and loads).<br>
<br>
David<br>
<br>
On 09/12/2019 11:29, Alberto Barbaro wrote:<br>
> Hi David,<br>
> Thanks for your email. I'm just trying to perform some basic analysis on <br>
> the IR. For instance, is it possible to understand if the variable %10 <br>
> depends on the value of the first parameter? I know that the first <br>
> parameter can be referenced as %0 but a proper name would increase the <br>
> readability. It is not so crucial for me atm.<br>
> <br>
> Thanks<br>
> Alberto<br>
> <br>
> On Mon, Dec 9, 2019, 11:01 David Chisnall via llvm-dev <br>
> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>>> wrote:<br>
> <br>
> Hi Alberto,<br>
> <br>
> Note that even with this, there isn't necessarily a 1:1 correspondence<br>
> between LLVM IR parameters and clang parameters. For example, a struct<br>
> passed by value in a C function may be one IR parameter per field, or<br>
> may be packed into an integer large enough to store the whole thing.<br>
> Similarly, return values may be indirect via sret pointers or they may<br>
> be explicit return values but of a different type (for example, on i386<br>
> a return of struct of a pair of int- or pointer-sized values may be<br>
> returned as a single i64 in LLVM IR).<br>
> <br>
> It would help to understand what you are trying to do, because there<br>
> may<br>
> be a better way of achieving your goal.<br>
> <br>
> David<br>
> <br>
> <br>
> On 08/12/2019 10:19, Alberto Barbaro via llvm-dev wrote:<br>
> > Hi Tim,<br>
> > My bad, I have installed a newer version of clang and all worked.<br>
> ><br>
> > Thanks<br>
> ><br>
> > On Sun, Dec 8, 2019, 10:05 Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank" rel="noreferrer">t.p.northover@gmail.com</a><br>
> <mailto:<a href="mailto:t.p.northover@gmail.com" target="_blank" rel="noreferrer">t.p.northover@gmail.com</a>><br>
> > <mailto:<a href="mailto:t.p.northover@gmail.com" target="_blank" rel="noreferrer">t.p.northover@gmail.com</a><br>
> <mailto:<a href="mailto:t.p.northover@gmail.com" target="_blank" rel="noreferrer">t.p.northover@gmail.com</a>>>> wrote:<br>
> ><br>
> > On Sun, 8 Dec 2019 at 09:54, Alberto Barbaro via llvm-dev<br>
> > <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>><br>
> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>>>><br>
> wrote:<br>
> > > thanks for your answer. Unfortunately I'm still using llvm 6.0<br>
> > and in llvm-dis I don't see that option. I tried reading the full<br>
> > list of options but I didn't see an alternative.<br>
> ><br>
> > The option is for Clang. Once you have the IR generated it's<br>
> too late,<br>
> > the names will already have been discarded.<br>
> ><br>
> > Cheers.<br>
> ><br>
> > Tim.<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > LLVM Developers mailing list<br>
> > <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>><br>
> > <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
> ><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a> <mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
> <br>
</blockquote></div>