<div dir="ltr"><div>Thanks for your reply.</div><div><br></div>Yes, I was about to recurse over the use list of the argument in the called function. I did not want to pursue that because with this solution, I am going to implement the interprocedural part myself and was wondering if that was not already done. I was not also 100% sure that this will work for any type of arguments.<div><br></div><div>If, based on your response, this is my only solution then I will go for it. </div><div><br></div><div>Thanks,</div><div>Dounia</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 26, 2016 at 5:51 PM, Sanjoy Das <span dir="ltr"><<a href="mailto:sanjoy@playingwithpointers.com" target="_blank">sanjoy@playingwithpointers.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Dounia,<span class=""><br>
<br>
Dounia Khaldi via llvm-dev wrote:<br>
> I have been using the USE class to access the use-def chains of<br>
> different values. However, what I have noticed is that the set of users<br>
> of a particular value is limited for the appearance of that variable in<br>
> the current function.<br>
><br>
> How can I get the interprocedural use of a particular value? For<br></span>
> example, if a variable /a/ is used as an argument in a function call<br>
> /foo/, the USE analysis would go to the definition of/foo/, and get me<span class=""><br>
> the users of that argument in the called function as well. Currently,<br>
> what USE does is that it returns the call as a use and stops there.<br>
<br></span>
Why not just recurse to uses of the corresponding llvm::Argument<br>
instance?  Is there a reason why you're avoiding that?  This won't<br>
work for varargs, but that's a difficult problem anyway.<br>
<br>
Specifically, I'm saying:<br>
<br>
  if (user is CallInst or InvokeInst) {<br>
    unsigned ArgNo = // Get argument no. of Use &<br>
    if (auto *F = getCallTargetIfPossible()) {<br>
      pushToWorklist(F->getArgument(ArgNo)->users()); // Or recurse<br>
    }<br>
  }<span class="HOEnZb"><font color="#888888"><br>
<br>
-- Sanjoy<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><span style="font-size:small">Dounia KHALDI</span><br></div><div dir="ltr"><span style="font-size:small">Research Assistant Professor</span><br style="font-size:small"><div style="font-size:12.8px"><font color="#000000">Institute for Advanced Computational Science</font></div><div style="font-size:12.8px"><font color="#000000"><span style="font-size:12.8px">Stony Brook University</span><br></font></div><div style="font-size:12.8px"><font color="#000000">Stony Brook, NY 11794-5250</font></div><div style="font-size:12.8px"><font color="#000000" style="color:rgb(17,85,204);font-size:12.8px"><a href="http://www.iacs.stonybrook.edu/" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">www.iacs.stonybrook.edu</a></font><br></div><div><br></div></div></div></div></div></div></div></div></div></div>
</div>