<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 8/4/11 2:45 PM, Manish Gupta wrote:
<blockquote
cite="mid:CAL6s+W=34cnvyNGOXk_rLapdOA_4pvcKrbSYqgO9KjPkX8ms_g@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hey John,
<div><br>
<div>Yes this is what I am looking for. I wrote a code as I
described in my first mail and I am getting desired result
except when the chain encounters load instruction (you have
also mentioned the that u skip loads). <br>
</div>
</div>
</blockquote>
<br>
Okay. Just out of curiosity, is your static slice local (stopping
at function arguments) or inter-procedural? Do you need an
inter-procedural slice? I have code that does both.<br>
<br>
<blockquote
cite="mid:CAL6s+W=34cnvyNGOXk_rLapdOA_4pvcKrbSYqgO9KjPkX8ms_g@mail.gmail.com"
type="cite">
<div>
<div><br>
</div>
<div>I think the recursive trace back for a Value V depending on
Operands (o1,...oN) should terminate at the nearest definition
of the oN (i.e. it is not an instruction but a LLVM Type).
Right?</div>
</div>
</blockquote>
<br>
No. The operands are not types. They are LLVM values (llvm::Value
*'s) and could be instructions (Instruction *), Constants (Constant
*), function arguments (Argument *), or any other object whose class
derives from llvm::Value.<br>
<br>
Regarding the idea of nearest definition, remember that the LLVM IR
is in SSA form. Each value (remember that all operands are Value
*'s) has a single definition. There is no nearest definition of a
value because each value is only defined once.<br>
<br>
<blockquote
cite="mid:CAL6s+W=34cnvyNGOXk_rLapdOA_4pvcKrbSYqgO9KjPkX8ms_g@mail.gmail.com"
type="cite">
<div>
<div> If you can release the code that would be a great help.</div>
</div>
</blockquote>
<br>
I'll ask my advisor.<br>
<br>
-- John T.<br>
<br>
<blockquote
cite="mid:CAL6s+W=34cnvyNGOXk_rLapdOA_4pvcKrbSYqgO9KjPkX8ms_g@mail.gmail.com"
type="cite">
<div>
<div> </div>
<div><br>
</div>
<div>Thanks,</div>
<div>Manish <br>
<br>
<div class="gmail_quote">On Thu, Aug 4, 2011 at 12:14 PM, John
Criswell <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:criswell@illinois.edu">criswell@illinois.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000">
<div class="im"> On 8/4/11 1:53 PM, Manish Gupta wrote:
<blockquote type="cite"> It would be great help if
someone can point me to similar code in Analysis or
Transform, i.e. tracing value dependencies chains. <br>
</blockquote>
<br>
</div>
If I understand correctly, given an instruction I, you
want to find its operands o1 through oN, and then find
the instructions (or LLVM values) that generate the
values o1 through oN, and then find the instructions
generating those values, etc, etc. In other words, you
want to take a static backwards slice of an
instruction. Is this correct?<br>
<br>
I don't know of code within LLVM that does this, but
I've written code to take an inter-procedural static
backwards slice (only through SSA values; loads are not
matched up to potential stores). If that's what you
need, I can ask my advisor if we can release that code
to you.<br>
<br>
Also, would others find it useful to have this code? I
think this is the second or third time someone's asked
for backwards static slicing code.<br>
<br>
-- John T.<br>
<br>
<blockquote type="cite">
<div class="im">
<div><br>
</div>
<div>Thanks,</div>
<div>Manish<br>
<br>
<div class="gmail_quote">On Wed, Aug 3, 2011 at
10:47 AM, Manish Gupta <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:manishg@cs.ucsd.edu"
target="_blank">manishg@cs.ucsd.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">Hello All,
<div><br>
</div>
<div>What would be the best way to trace Value
Dependency Chains in LLVM. Can I use some
API to perform this?</div>
<div><br>
</div>
<div>The use-def chain process mentioned at <a
moz-do-not-send="true"
href="http://llvm.org/docs/ProgrammersManual.html#iterate_chains"
target="_blank">http://llvm.org/docs/ProgrammersManual.html#iterate_chains</a> will
just get the values (Operands) being used in
the current Instruction. For getting the
values operands in the particular
instruction are influenced from I have
to recursively call the use-def on these
operands. I was wondering if there is
already available better way of doing this
in LLVM. </div>
<div><br>
</div>
<div>Thanks,</div>
<div>Manish</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
<pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>