[LLVMdev] Free Variables In a Loop.
ayoga at umail.iu.edu
Mon Apr 19 10:34:46 PDT 2010
Thanks, this would work. But we are interested in obtaining the instruction
that defines/allocates the value of interest. Once we obtain that we can use
LoopInfo pass to check whether the basic block containing that definition
instruction belongs to the loop in question. Is there a method that returns
the defining instruction?
On Mon, Apr 19, 2010 at 10:05 AM, John Criswell <criswell at uiuc.edu> wrote:
> 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.
> > Thanks,
> > Rohith.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
Graduate Student, Computer Science
Indiana University, Bloomington
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev