It's not too much of a problem then. I can make a DenseMap between the registers and my registers. It's just one more intermediate step for a lookup.<div><br><div>I wish to mimic all the of the registers on the machine with my std::vector<RegisterInfo> RegisterIndexes; vector. Then when a register is used I can assign it easily. I know about alias register and those are taken care of ever so cleverly. </div>
<div><br></div><div>If this can be done without an extra lookup, it would improve performance. I have one too many as is in some parts.</div><div><br></div><div>Thanks,</div><div>Jeff Kunkel</div><div><br><div class="gmail_quote">
On Fri, Sep 3, 2010 at 12:57 PM, Jim Grosbach <span dir="ltr"><<a href="mailto:grosbach@apple.com">grosbach@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
TargetRegisterInfo::getNumRegs().<br>
<br>
Generally, it's best not to make any assumptions about the internal ordering or numbering if you can avoid it. What are you looking to do?<br>
<font color="#888888"><br>
-Jim<br>
</font><div><div></div><div class="h5"><br>
On Sep 3, 2010, at 9:37 AM, Jeff Kunkel wrote:<br>
<br>
> How do I get the total number of machine registers? I have currently a MachineFunction and some derivatives.<br>
><br>
> How are the machine registers ordered internally? Can I index them off of a zero based array or do I have to create a map to have them be zero based?<br>
><br>
> Thanks,<br>
> Jeff Kunkel<br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</div></div></blockquote></div><br></div></div>