[LLVMdev] #uses

xli3 at uiuc.edu xli3 at uiuc.edu
Tue Sep 17 16:48:01 PDT 2002


When I use the llvm to print out the code, it actually gives
out the number of uses for each variable, for example, I get
lines like this:

 %S.i = alloca %struct.SimpleStruct          ;
<%struct.SimpleStruct*> [#uses=3]

or this

%cast216.i = getelementptr %struct.SimpleStruct* %S.i, long 0,
ubyte 0          ; <int*> [#uses=1]

My question is how the program knows about the number of uses.
If I want to check all the future uses of this variable, say
%S.i. Is there a way that I can directly find the uses of this
variable? Or I have to iterate over the function, inspect all
the instructions and ompare all the operands of each
instruction to see if they are the same?

Thanks,
xiaodong



More information about the llvm-dev mailing list