[LLVMdev] def-use chains and use-def chains

Duncan Sands baldrick at free.fr
Thu Apr 19 09:22:42 PDT 2012


Hi,

> I need to find out all the places where the value of a variable is being used.

you didn't define what you mean by a variable.  LLVM has virtual registers which
are always in SSA form, and memory (such as created by an AllocaInst).  By a
"variable" do you mean an SSA register, or do you mean a chunk of memory?

Ciao, Duncan.

> For this I have to implement reaching definitions(def-use chains).
> When I searched for its implementation I found Iterating over def-use & use-def
> chains <http://llvm.org/docs/ProgrammersManual.html#iterate_chains>. will this
> work for finding the places where a variable is reaching?
>
> I tried to use "use_iterator", but couldn't make it out. Is it a must to write
> LLVM Pass to use op_iterator and use_iterator?
> please give me any references or examples to understand more about use_iterator.
>
>
> Best Regards,
> Srikanth Vaindam
>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list