[LLVMdev] Free Variables In a Loop.
criswell at uiuc.edu
Mon Apr 19 07:05:23 PDT 2010
Rohith Goparaju wrote:
> Hi ,
> I'm working on a project in which i need to find out all free
> variables in a loop. I need to find all variables used inside a loop
> and that are not declared(allocated) in the loop. I'm confused about
> what symbol tables to use to get hold of such variables.
When you say "variables," are you talking about LLVM virtual registers
or memory allocated by the alloca instruction?
Assuming the former, LLVM virtual registers are in SSA form, meaning
that they are defined only once and that the virtual register
representing the value and the instruction that generates that value are
synonymous. If you want to see if an SSA value is defined within a
loop, you would use the LoopInfo pass to determine if the basic block
containing the instruction defining the value of interest belongs to
the loop that interests you.
Information on LoopInfo can be found at
-- John T.
More information about the llvm-dev