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? Regards, Rajwinder Singh -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100623/37038c90/attachment.html>
What would you need the name for? If you're using the C++ API you just pass it as a Value* to the IRBuilder API. Reid On Wed, Jun 23, 2010 at 11:19 AM, RAJWINDER SINGH <rajwindersingh85 at gmail.com> 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? > Regards, > Rajwinder Singh > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
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
Hello Rajwinder, When you are using numbered registers there is no name to get. Names are optional in LLVM. --Sam> >From: RAJWINDER SINGH <rajwindersingh85 at gmail.com> >To: llvmdev at cs.uiuc.edu >Sent: Wed, June 23, 2010 1:19:38 PM >Subject: [LLVMdev] LLVM:help > > >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? > > >>Regards, >Rajwinder Singh-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100623/736aa4fb/attachment.html>
RAJWINDER SINGH wrote:> 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 > > >