[LLVMdev] about llvm::use

Hui Zhang wayne.huizhang at gmail.com
Tue Mar 24 13:15:29 PDT 2015


Hello, all

 I don't quite understand the llvm::use class, from the class ref, I read
that:

*"A Use <http://llvm.org/docs/doxygen/html/classllvm_1_1Use.html>
represents the edge between a Value
<http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html> definition and
its users.This is notionally a two-dimensional linked list"*

I can image that it's like an edge between the operand<->User, but how to
comprehend the "two-dimensional linked list" ?

(*Instruction derives from User that derives from Value*)

And I found "use_iterator()" in Value, for example: a Value 'v',  if it's
an operand of many Instructions 'i1,i2,i3...', then in my understanding,
uses of v are just i1, i2, i3... but what's the difference between use and
user in this case ??

Besides, if the Value 'v' here is itself an Instruction, then what are its
'uses' and 'users' ?? I feel that the result of an instruction can be an
operand of another instruction, but it should not be regarded as the
instruction itself right ??

Very confused...hope I can get some help to clarify my thoughts....

thanks




-- 
Best regards


Hui Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150324/f03eaf23/attachment.html>


More information about the llvm-dev mailing list