On 8/4/11 1:53 PM, Manish Gupta wrote:> It would be great help if someone can point me to similar code in
> Analysis or Transform, i.e. tracing value dependencies chains.
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?
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.
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.
-- John T.
>
> Thanks,
> Manish
>
> On Wed, Aug 3, 2011 at 10:47 AM, Manish Gupta <manishg at cs.ucsd.edu
> <mailto:manishg at cs.ucsd.edu>> wrote:
>
> Hello All,
>
> What would be the best way to trace Value Dependency Chains in
> LLVM. Can I use some API to perform this?
>
> The use-def chain process mentioned at
> http://llvm.org/docs/ProgrammersManual.html#iterate_chains 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.
>
> Thanks,
> Manish
>
>
>
>
> _______________________________________________
> 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/20110804/92ab5f53/attachment.html>