infinite number of virtual registers - sorry, modified.

I am making a backend for a virtual machine.
But it does assume infinite number of virtual registers unlike those of usual machines.
In this case, how can I implement this?
Would you mind telling me some tips?
Thank you so much.

Seung Jae Lee

Dear Seung,

     the number of virtual registers is unbounded. In your code, you can create as many as you want. The number of 'physical' registers is limited, and depends on the target architecture, e.g 32 integer regs in PowerPC, 8 registers of 16 bits in X86, etc. You can use the method below to create new virtual registers any time you need:

// This method creates a new virtual register with the same class as
// reg_model.
unsigned SplitPhiGroups_Fer::create_new_virtual_register(
     unsigned reg_model
) {
     // Take the register class.
     const TargetRegisterClass *trc =
     SSARegMap * srm = this->machine_function->getSSARegMap();
     unsigned new_reg = srm->createVirtualRegister(trc);
     return new_reg;