<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><br>Hi Amara,<div><br></div><div>Thanks for the response.</div><div><br></div><div>Yes. I could use the LLVM custom RTTI implementation. However, i think there isnt a type called VirtualRegister. If it exists, i could do a dyn_cast<> to check if an operand (represented by Value *) is indeed virtual-register or not. I hope i explained the problem i am facing.</div><div><br></div><div>BR/Nizam</div><div><br></div><div><br></div><div><hr id="zwchr"><b>From: </b>"Amara Emerson" <amara.emerson@gmail.com><br><b>To: </b>nizam@cse.iitm.ac.in<br><b>Cc: </b>"Tim Northover" <t.p.northover@gmail.com>, "Sean Silva" <chisophugis@gmail.com>, "llvmdev" <llvmdev@cs.uiuc.edu><br><b>Sent: </b>Monday, February 3, 2014 4:45:28 PM<br><b>Subject: </b>Re: [LLVMdev] LoadInst result<br><br>You can use the LLVM custom RTTI implementation to distinguish between<br>different kinds of Value using dyn_cast<>, isa<>. See<br>http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates<br><br>As Tim said, Values exist before regalloc. When you see a reference<br>like %foo in the IR, it's a reference to the Value, not the actual<br>virtual register.<br><br>Amara<br><br>On 3 February 2014 10:19,  <nizam@cse.iitm.ac.in> wrote:<br>> Hi Tim,<br>><br>> Assume a store instruction. Store has 2 Operands. I can use the<br>> store->getOperand(0) and store->getOperand(1) methods to access these<br>> operands in form of Value *.<br>><br>> Very likely that the operands are stack variables or formal variables or<br>> global variables. It is also possible that these operands are LLVM<br>> virtual-registers. Is there a way to determine if a given operand is a<br>> virtual-register or memory-related-on.<br>><br>> I hope this clarifies my question.<br>> BR/Nizam<br>><br>><br>> ________________________________<br>> From: "Tim Northover" <t.p.northover@gmail.com><br>> To: nizam@cse.iitm.ac.in<br>> Cc: "Sean Silva" <chisophugis@gmail.com>, "llvmdev" <llvmdev@cs.uiuc.edu><br>> Sent: Monday, February 3, 2014 3:42:29 PM<br>><br>> Subject: Re: [LLVMdev] LoadInst result<br>><br>> Hi Nizam,<br>><br>>> Is there a simple way to check if a given instruction operand (represented<br>>> by Value *) is a virtual register or otherwise? Context: I am creating a<br>>> ModulePass for pointer Analysis.<br>><br>> Values exist before any distinction is made between virtual and<br>> physical registers (they only get introduced after or, in rare cases<br>> at lowering to MachineInstrs). Or did you mean some distinction other<br>> than virtual/physical? What would you expect the Value to be if it's<br>> not a virtual register?<br>><br>> Cheers.<br>><br>> Tim.<br>><br>> _______________________________________________<br>> LLVM Developers mailing list<br>> LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu<br>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev<br>><br></div></div></body></html>