Thanks for your help with me about the way to access type and size of Value.<div>But, I want also know the interface for me to access  the type or size of virtual registers in the SSA form. </div><div>1. I find no way to associate the virtual registers with the Value class.</div>
<div>2. I also tried to get the size of register nReg by: </div><div>  TargetRegisterClass::getSize(), where the TargetRegisterClass object is obtained by  MachineRegisterInfo::getRegClass( nReg ). </div><div> But, I found it always returned with the value 4 bytes, say, GR32 (My target is the x86-32 bits). If all virtual registers were size of 32 bits, how could we consider the alias register file during register allocation? Namely, if a temporary value could be stored in 8 bits, why do we give it 32 bits? So, I doubt my second way to get the size of virtual register was wrong. Need your further help.</div>
<div><br><div class="gmail_quote">2011/1/28 John Criswell <span dir="ltr"><<a href="mailto:criswell@illinois.edu">criswell@illinois.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 1/27/11 3:23 AM, Qingan Li wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I wonder if there is an interface for me to access the type or size of virtual registers in the SSA form?<br>
I have scanned the MachineOperand in CodeGen part, and failed to find this kind of info for virtual registers.<br>
</blockquote>
<br></div>
The getType() method of Value * will return the LLVM type.  The TargetData class will provide information on size for a type on a particular hardware platform.<br>
<br>
-- John T.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-- <br>
Best regards,<br>
<br>
Li Qingan<br>
<br>
</blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Best regards,<div><br></div><div>Li Qingan</div><br>
</div>