[LLVMdev] LLVM:help

John Criswell criswell at uiuc.edu
Thu Jun 24 08:15:41 PDT 2010

> I am making a CDFG graph out of the instruction.

What is a CDFG?  Do you mean a control dependence graph?  
Control-dependence can be computed utilizing the PostDominatorTree pass.
> for that purpose I require the name because
> if I am using its ID then ID may be same for the two such variables.

What do you mean by an instruction's ID?

> How can I distinguish b/w them?

I'm assuming that you're writing an LLVM analysis pass that creates this 
CDFG data structure as an internal, in-memory data structure.  If that 
is the case, then you simply use the pointer to the Instruction object 
to identify it.  Each Instruction object inhabits a different location 
in memory; therefore, pointers to them are unique.

-- John T.

> --Rajwinder Singh
> On Thu, Jun 24, 2010 at 12:12 AM, John Criswell <criswell at uiuc.edu 
> <mailto:criswell at uiuc.edu>> wrote:
>     RAJWINDER SINGH wrote:
>         Sir ,how can I get the variable %2 in instruction
>          %2 = sub nsw i32 1, %y   If I am using getName() function
>         then it outputs the null string.
>         How can I get the original name?
>     I don't believe the instruction has a name.  The LLVM disassembler
>     just assigns a numeric name when generating the .ll file so that
>     the output is readable by a human.
>     What is it that you are trying to do that requires that name of an
>     SSA value?
>     -- John T.
>         Regards,
>         Rajwinder Singh

More information about the llvm-dev mailing list