blob: 9ed6ad98953e0ce2d18f64d4e9eba0b3c736cc10 [file] [log] [blame]
Chris Lattner1d62cea2002-12-16 14:37:00 +00001//===-- RegAllocSimple.cpp - A simple generic register allocator ----------===//
Misha Brukman07218672002-11-22 22:44:32 +00002//
3// This file implements a simple register allocator. *Very* simple.
4//
5//===----------------------------------------------------------------------===//
6
Misha Brukman07218672002-11-22 22:44:32 +00007#include "llvm/CodeGen/MachineFunction.h"
Chris Lattnerabe8dd52002-12-15 18:19:24 +00008#include "llvm/CodeGen/MachineInstr.h"
Misha Brukmandd46e2a2002-12-04 23:58:08 +00009#include "llvm/Target/MachineInstrInfo.h"
Misha Brukman07218672002-11-22 22:44:32 +000010#include "llvm/Target/TargetMachine.h"
Misha Brukman07218672002-11-22 22:44:32 +000011#include "Support/Statistic.h"
Chris Lattnerabe8dd52002-12-15 18:19:24 +000012#include <iostream>
Chris Lattnerda7e4532002-12-15 20:36:09 +000013#include <set>
Misha Brukman07218672002-11-22 22:44:32 +000014
Misha Brukman59b3eed2002-12-13 10:42:31 +000015namespace {
Chris Lattnerda7e4532002-12-15 20:36:09 +000016 Statistic<> NumSpilled ("ra-simple", "Number of registers spilled");
17 Statistic<> NumReloaded("ra-simple", "Number of registers reloaded");
18
19 class RegAllocSimple : public FunctionPass {
Misha Brukman07218672002-11-22 22:44:32 +000020 TargetMachine &TM;
Misha Brukman07218672002-11-22 22:44:32 +000021 MachineFunction *MF;
Misha Brukman07218672002-11-22 22:44:32 +000022 const MRegisterInfo *RegInfo;
Chris Lattner9593fb12002-12-15 19:07:34 +000023 unsigned NumBytesAllocated;
Misha Brukman07218672002-11-22 22:44:32 +000024
25 // Maps SSA Regs => offsets on the stack where these values are stored
Chris Lattnerad44bd92002-12-15 18:15:24 +000026 std::map<unsigned, unsigned> VirtReg2OffsetMap;
Misha Brukman07218672002-11-22 22:44:32 +000027
Chris Lattnerda7e4532002-12-15 20:36:09 +000028 // RegsUsed - Keep track of what registers are currently in use.
29 std::set<unsigned> RegsUsed;
30
31 // RegClassIdx - Maps RegClass => which index we can take a register
32 // from. Since this is a simple register allocator, when we need a register
33 // of a certain class, we just take the next available one.
Misha Brukman07218672002-11-22 22:44:32 +000034 std::map<const TargetRegisterClass*, unsigned> RegClassIdx;
35
Chris Lattnerda7e4532002-12-15 20:36:09 +000036 public:
37
Chris Lattnerc2db1a92002-12-15 19:51:14 +000038 RegAllocSimple(TargetMachine &tm)
Chris Lattner9f366d72002-12-15 22:19:19 +000039 : TM(tm), RegInfo(tm.getRegisterInfo()) {
Chris Lattnerda7e4532002-12-15 20:36:09 +000040 RegsUsed.insert(RegInfo->getFramePointer());
41 RegsUsed.insert(RegInfo->getStackPointer());
Misha Brukmancea22452002-12-13 04:34:02 +000042
43 cleanupAfterFunction();
Misha Brukman07218672002-11-22 22:44:32 +000044 }
45
Chris Lattnerda7e4532002-12-15 20:36:09 +000046 bool runOnFunction(Function &Fn) {
47 return runOnMachineFunction(MachineFunction::get(&Fn));
48 }
49
Chris Lattner8233e2f2002-12-15 21:13:12 +000050 virtual const char *getPassName() const {
51 return "Simple Register Allocator";
52 }
53
Chris Lattnerda7e4532002-12-15 20:36:09 +000054 private:
55 /// runOnMachineFunction - Register allocate the whole function
56 bool runOnMachineFunction(MachineFunction &Fn);
57
58 /// AllocateBasicBlock - Register allocate the specified basic block.
59 void AllocateBasicBlock(MachineBasicBlock &MBB);
60
61 /// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions
62 /// in predecessor basic blocks.
63 void EliminatePHINodes(MachineBasicBlock &MBB);
64
65
Chris Lattner9f366d72002-12-15 22:19:19 +000066 /// getStackSpaceFor - This returns the offset of the specified virtual
67 /// register on the stack, allocating space if neccesary.
68 unsigned getStackSpaceFor(unsigned VirtReg,
69 const TargetRegisterClass *regClass);
Misha Brukman07218672002-11-22 22:44:32 +000070
Chris Lattner9f366d72002-12-15 22:19:19 +000071 /// Given a virtual register, return a compatible physical register that is
72 /// currently unused.
Chris Lattnerda7e4532002-12-15 20:36:09 +000073 ///
Misha Brukman07218672002-11-22 22:44:32 +000074 /// Side effect: marks that register as being used until manually cleared
Chris Lattnerda7e4532002-12-15 20:36:09 +000075 ///
Misha Brukman07218672002-11-22 22:44:32 +000076 unsigned getFreeReg(unsigned virtualReg);
77
78 /// Returns all `borrowed' registers back to the free pool
79 void clearAllRegs() {
Chris Lattnerc2db1a92002-12-15 19:51:14 +000080 RegClassIdx.clear();
Misha Brukman07218672002-11-22 22:44:32 +000081 }
82
Misha Brukman972b03f2002-12-13 11:33:22 +000083 /// Invalidates any references, real or implicit, to physical registers
84 ///
85 void invalidatePhysRegs(const MachineInstr *MI) {
86 unsigned Opcode = MI->getOpcode();
Chris Lattnerda7e4532002-12-15 20:36:09 +000087 const MachineInstrDescriptor &Desc = TM.getInstrInfo().get(Opcode);
Misha Brukman972b03f2002-12-13 11:33:22 +000088 const unsigned *regs = Desc.ImplicitUses;
89 while (*regs)
Chris Lattnerda7e4532002-12-15 20:36:09 +000090 RegsUsed.insert(*regs++);
Misha Brukman972b03f2002-12-13 11:33:22 +000091
92 regs = Desc.ImplicitDefs;
93 while (*regs)
Chris Lattnerda7e4532002-12-15 20:36:09 +000094 RegsUsed.insert(*regs++);
Misha Brukman972b03f2002-12-13 11:33:22 +000095 }
96
Misha Brukmandd46e2a2002-12-04 23:58:08 +000097 void cleanupAfterFunction() {
Chris Lattnerad44bd92002-12-15 18:15:24 +000098 VirtReg2OffsetMap.clear();
Chris Lattnerc2db1a92002-12-15 19:51:14 +000099 NumBytesAllocated = 4; // FIXME: This is X86 specific
Misha Brukmandd46e2a2002-12-04 23:58:08 +0000100 }
101
Misha Brukman07218672002-11-22 22:44:32 +0000102 /// Moves value from memory into that register
Chris Lattnerb167c042002-12-15 23:01:26 +0000103 unsigned reloadVirtReg(MachineBasicBlock &MBB,
104 MachineBasicBlock::iterator &I, unsigned VirtReg);
Misha Brukman07218672002-11-22 22:44:32 +0000105
106 /// Saves reg value on the stack (maps virtual register to stack value)
Chris Lattnerb167c042002-12-15 23:01:26 +0000107 void spillVirtReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator &I,
108 unsigned VirtReg, unsigned PhysReg);
Misha Brukman07218672002-11-22 22:44:32 +0000109 };
110
Misha Brukman59b3eed2002-12-13 10:42:31 +0000111}
Misha Brukman07218672002-11-22 22:44:32 +0000112
Chris Lattner9f366d72002-12-15 22:19:19 +0000113/// getStackSpaceFor - This allocates space for the specified virtual
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000114/// register to be held on the stack.
Chris Lattner9f366d72002-12-15 22:19:19 +0000115unsigned RegAllocSimple::getStackSpaceFor(unsigned VirtReg,
116 const TargetRegisterClass *regClass) {
117 // Find the location VirtReg would belong...
118 std::map<unsigned, unsigned>::iterator I =
119 VirtReg2OffsetMap.lower_bound(VirtReg);
Chris Lattner9593fb12002-12-15 19:07:34 +0000120
Chris Lattner9f366d72002-12-15 22:19:19 +0000121 if (I != VirtReg2OffsetMap.end() && I->first == VirtReg)
122 return I->second; // Already has space allocated?
Chris Lattner9593fb12002-12-15 19:07:34 +0000123
Chris Lattner9f366d72002-12-15 22:19:19 +0000124 unsigned RegSize = regClass->getDataSize();
Chris Lattner9593fb12002-12-15 19:07:34 +0000125
Chris Lattner9f366d72002-12-15 22:19:19 +0000126 // Align NumBytesAllocated. We should be using TargetData alignment stuff
127 // to determine this, but we don't know the LLVM type associated with the
128 // virtual register. Instead, just align to a multiple of the size for now.
129 NumBytesAllocated += RegSize-1;
130 NumBytesAllocated = NumBytesAllocated/RegSize*RegSize;
131
132 // Assign the slot...
133 VirtReg2OffsetMap.insert(I, std::make_pair(VirtReg, NumBytesAllocated));
134
135 // Reserve the space!
136 NumBytesAllocated += RegSize;
137 return NumBytesAllocated-RegSize;
Misha Brukmanf514d512002-12-02 21:11:58 +0000138}
139
Misha Brukman07218672002-11-22 22:44:32 +0000140unsigned RegAllocSimple::getFreeReg(unsigned virtualReg) {
141 const TargetRegisterClass* regClass = MF->getRegClass(virtualReg);
Chris Lattner9f366d72002-12-15 22:19:19 +0000142
143 unsigned regIdx = RegClassIdx[regClass]++;
144 assert(regIdx < regClass->getNumRegs() && "Not enough registers!");
145 unsigned physReg = regClass->getRegister(regIdx);
Misha Brukman07218672002-11-22 22:44:32 +0000146
Chris Lattner9f366d72002-12-15 22:19:19 +0000147 if (RegsUsed.find(physReg) == RegsUsed.end())
Misha Brukman07218672002-11-22 22:44:32 +0000148 return physReg;
Chris Lattnerda7e4532002-12-15 20:36:09 +0000149 else
Misha Brukman07218672002-11-22 22:44:32 +0000150 return getFreeReg(virtualReg);
Misha Brukman07218672002-11-22 22:44:32 +0000151}
152
Chris Lattnerb167c042002-12-15 23:01:26 +0000153unsigned RegAllocSimple::reloadVirtReg(MachineBasicBlock &MBB,
154 MachineBasicBlock::iterator &I,
155 unsigned VirtReg) {
Misha Brukman07218672002-11-22 22:44:32 +0000156 const TargetRegisterClass* regClass = MF->getRegClass(VirtReg);
Chris Lattner9f366d72002-12-15 22:19:19 +0000157 unsigned stackOffset = getStackSpaceFor(VirtReg, regClass);
Chris Lattnerb167c042002-12-15 23:01:26 +0000158 unsigned PhysReg = getFreeReg(VirtReg);
Misha Brukman07218672002-11-22 22:44:32 +0000159
Misha Brukmanf514d512002-12-02 21:11:58 +0000160 // Add move instruction(s)
Chris Lattnerda7e4532002-12-15 20:36:09 +0000161 ++NumReloaded;
Chris Lattnerb167c042002-12-15 23:01:26 +0000162 I = RegInfo->loadRegOffset2Reg(MBB, I, PhysReg, RegInfo->getFramePointer(),
163 -stackOffset, regClass->getDataSize());
164 return PhysReg;
Misha Brukman07218672002-11-22 22:44:32 +0000165}
166
Chris Lattnerb167c042002-12-15 23:01:26 +0000167void RegAllocSimple::spillVirtReg(MachineBasicBlock &MBB,
168 MachineBasicBlock::iterator &I,
169 unsigned VirtReg, unsigned PhysReg)
Misha Brukman07218672002-11-22 22:44:32 +0000170{
171 const TargetRegisterClass* regClass = MF->getRegClass(VirtReg);
Chris Lattner9f366d72002-12-15 22:19:19 +0000172 unsigned stackOffset = getStackSpaceFor(VirtReg, regClass);
Misha Brukmanf514d512002-12-02 21:11:58 +0000173
Misha Brukman07218672002-11-22 22:44:32 +0000174 // Add move instruction(s)
Chris Lattnerda7e4532002-12-15 20:36:09 +0000175 ++NumSpilled;
Chris Lattnerb167c042002-12-15 23:01:26 +0000176 I = RegInfo->storeReg2RegOffset(MBB, I, PhysReg, RegInfo->getFramePointer(),
177 -stackOffset, regClass->getDataSize());
Misha Brukman07218672002-11-22 22:44:32 +0000178}
179
Misha Brukmandc2ec002002-12-03 23:15:19 +0000180
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000181/// EliminatePHINodes - Eliminate phi nodes by inserting copy instructions in
182/// predecessor basic blocks.
Chris Lattner8ed9eb52002-12-15 22:39:53 +0000183///
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000184void RegAllocSimple::EliminatePHINodes(MachineBasicBlock &MBB) {
Chris Lattnerda7e4532002-12-15 20:36:09 +0000185 const MachineInstrInfo &MII = TM.getInstrInfo();
186
Chris Lattner9f366d72002-12-15 22:19:19 +0000187 while (MBB.front()->getOpcode() == MachineInstrInfo::PHI) {
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000188 MachineInstr *MI = MBB.front();
Chris Lattner9f366d72002-12-15 22:19:19 +0000189 // Unlink the PHI node from the basic block... but don't delete the PHI yet
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000190 MBB.erase(MBB.begin());
191
Chris Lattner9f366d72002-12-15 22:19:19 +0000192 DEBUG(std::cerr << "num ops: " << MI->getNumOperands() << "\n");
193 assert(MI->getOperand(0).isVirtualRegister() &&
194 "PHI node doesn't write virt reg?");
195
Chris Lattner9f366d72002-12-15 22:19:19 +0000196 unsigned virtualReg = MI->getOperand(0).getAllocatedRegNum();
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000197
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000198 for (int i = MI->getNumOperands() - 1; i >= 2; i-=2) {
199 MachineOperand &opVal = MI->getOperand(i-1);
200
201 // Get the MachineBasicBlock equivalent of the BasicBlock that is the
202 // source path the phi
203 MachineBasicBlock &opBlock = *MI->getOperand(i).getMachineBasicBlock();
Misha Brukmandd46e2a2002-12-04 23:58:08 +0000204
Chris Lattner3f91ad72002-12-15 20:48:03 +0000205 // Check to make sure we haven't already emitted the copy for this block.
206 // This can happen because PHI nodes may have multiple entries for the
207 // same basic block. It doesn't matter which entry we use though, because
208 // all incoming values are guaranteed to be the same for a particular bb.
209 //
210 // Note that this is N^2 in the number of phi node entries, but since the
211 // # of entries is tiny, this is not a problem.
212 //
213 bool HaveNotEmitted = true;
214 for (int op = MI->getNumOperands() - 1; op != i; op -= 2)
215 if (&opBlock == MI->getOperand(op).getMachineBasicBlock()) {
216 HaveNotEmitted = false;
217 break;
218 }
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000219
Chris Lattner3f91ad72002-12-15 20:48:03 +0000220 if (HaveNotEmitted) {
221 MachineBasicBlock::iterator opI = opBlock.end();
222 MachineInstr *opMI = *--opI;
223
224 // must backtrack over ALL the branches in the previous block
225 while (MII.isBranch(opMI->getOpcode()) && opI != opBlock.begin())
226 opMI = *--opI;
227
228 // move back to the first branch instruction so new instructions
229 // are inserted right in front of it and not in front of a non-branch
230 if (!MII.isBranch(opMI->getOpcode()))
231 ++opI;
Chris Lattner8ed9eb52002-12-15 22:39:53 +0000232
233 unsigned dataSize = MF->getRegClass(virtualReg)->getDataSize();
234
Chris Lattner3f91ad72002-12-15 20:48:03 +0000235 // Retrieve the constant value from this op, move it to target
236 // register of the phi
237 if (opVal.isImmediate()) {
Chris Lattner8ed9eb52002-12-15 22:39:53 +0000238 opI = RegInfo->moveImm2Reg(opBlock, opI, virtualReg,
Chris Lattner3f91ad72002-12-15 20:48:03 +0000239 (unsigned) opVal.getImmedValue(),
240 dataSize);
Chris Lattner3f91ad72002-12-15 20:48:03 +0000241 } else {
Chris Lattner8ed9eb52002-12-15 22:39:53 +0000242 opI = RegInfo->moveReg2Reg(opBlock, opI, virtualReg,
243 opVal.getAllocatedRegNum(), dataSize);
Chris Lattner3f91ad72002-12-15 20:48:03 +0000244 }
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000245 }
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000246 }
247
Chris Lattner9f366d72002-12-15 22:19:19 +0000248 // really delete the PHI instruction now!
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000249 delete MI;
250 }
251}
252
253
254void RegAllocSimple::AllocateBasicBlock(MachineBasicBlock &MBB) {
Chris Lattnerf6050552002-12-15 21:33:51 +0000255 // loop over each instruction
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000256 for (MachineBasicBlock::iterator I = MBB.begin(); I != MBB.end(); ++I) {
Chris Lattner01b08c52002-12-15 21:24:30 +0000257 // Made to combat the incorrect allocation of r2 = add r1, r1
Chris Lattner9f366d72002-12-15 22:19:19 +0000258 std::map<unsigned, unsigned> Virt2PhysRegMap;
Chris Lattner01b08c52002-12-15 21:24:30 +0000259
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000260 MachineInstr *MI = *I;
261
262 // a preliminary pass that will invalidate any registers that
263 // are used by the instruction (including implicit uses)
264 invalidatePhysRegs(MI);
265
266 // Loop over uses, move from memory into registers
267 for (int i = MI->getNumOperands() - 1; i >= 0; --i) {
268 MachineOperand &op = MI->getOperand(i);
269
Chris Lattnerda7e4532002-12-15 20:36:09 +0000270 if (op.isVirtualRegister()) {
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000271 unsigned virtualReg = (unsigned) op.getAllocatedRegNum();
272 DEBUG(std::cerr << "op: " << op << "\n");
273 DEBUG(std::cerr << "\t inst[" << i << "]: ";
274 MI->print(std::cerr, TM));
275
276 // make sure the same virtual register maps to the same physical
277 // register in any given instruction
Chris Lattner9f366d72002-12-15 22:19:19 +0000278 unsigned physReg = Virt2PhysRegMap[virtualReg];
279 if (physReg == 0) {
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000280 if (op.opIsDef()) {
281 if (TM.getInstrInfo().isTwoAddrInstr(MI->getOpcode()) && i == 0) {
282 // must be same register number as the first operand
283 // This maps a = b + c into b += c, and saves b into a's spot
Chris Lattner15f96db2002-12-15 21:02:20 +0000284 assert(MI->getOperand(1).isRegister() &&
285 MI->getOperand(1).getAllocatedRegNum() &&
Chris Lattner9f366d72002-12-15 22:19:19 +0000286 MI->getOperand(1).opIsUse() &&
Chris Lattner15f96db2002-12-15 21:02:20 +0000287 "Two address instruction invalid!");
288
Chris Lattnerda7e4532002-12-15 20:36:09 +0000289 physReg = MI->getOperand(1).getAllocatedRegNum();
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000290 } else {
291 physReg = getFreeReg(virtualReg);
292 }
Chris Lattnerb167c042002-12-15 23:01:26 +0000293 ++I;
294 spillVirtReg(MBB, I, virtualReg, physReg);
295 --I;
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000296 } else {
Chris Lattnerb167c042002-12-15 23:01:26 +0000297 physReg = reloadVirtReg(MBB, I, virtualReg);
298 Virt2PhysRegMap[virtualReg] = physReg;
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000299 }
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000300 }
301 MI->SetMachineOperandReg(i, physReg);
302 DEBUG(std::cerr << "virt: " << virtualReg <<
303 ", phys: " << op.getAllocatedRegNum() << "\n");
304 }
305 }
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000306 clearAllRegs();
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000307 }
308}
309
Chris Lattnerda7e4532002-12-15 20:36:09 +0000310/// runOnMachineFunction - Register allocate the whole function
311///
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000312bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
Misha Brukman07218672002-11-22 22:44:32 +0000313 DEBUG(std::cerr << "Machine Function " << "\n");
314 MF = &Fn;
Misha Brukmandc2ec002002-12-03 23:15:19 +0000315
Chris Lattner8ed9eb52002-12-15 22:39:53 +0000316 // First pass: eliminate PHI instructions by inserting copies into predecessor
317 // blocks.
318 for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
319 MBB != MBBe; ++MBB)
320 EliminatePHINodes(*MBB);
321
Chris Lattner9f366d72002-12-15 22:19:19 +0000322 // Loop over all of the basic blocks, eliminating virtual register references
Misha Brukman07218672002-11-22 22:44:32 +0000323 for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
324 MBB != MBBe; ++MBB)
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000325 AllocateBasicBlock(*MBB);
Misha Brukman07218672002-11-22 22:44:32 +0000326
Chris Lattner9f366d72002-12-15 22:19:19 +0000327 // Add prologue to the function...
Chris Lattner198ab642002-12-15 20:06:35 +0000328 RegInfo->emitPrologue(Fn, NumBytesAllocated);
Misha Brukmandd46e2a2002-12-04 23:58:08 +0000329
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000330 const MachineInstrInfo &MII = TM.getInstrInfo();
331
Chris Lattner9f366d72002-12-15 22:19:19 +0000332 // Add epilogue to restore the callee-save registers in each exiting block
Misha Brukmandd46e2a2002-12-04 23:58:08 +0000333 for (MachineFunction::iterator MBB = Fn.begin(), MBBe = Fn.end();
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000334 MBB != MBBe; ++MBB) {
Chris Lattner9f366d72002-12-15 22:19:19 +0000335 // If last instruction is a return instruction, add an epilogue
336 if (MII.isReturn(MBB->back()->getOpcode()))
Chris Lattner198ab642002-12-15 20:06:35 +0000337 RegInfo->emitEpilogue(*MBB, NumBytesAllocated);
Misha Brukmandd46e2a2002-12-04 23:58:08 +0000338 }
Misha Brukman07218672002-11-22 22:44:32 +0000339
Chris Lattnerc2db1a92002-12-15 19:51:14 +0000340 cleanupAfterFunction();
Chris Lattner9f366d72002-12-15 22:19:19 +0000341 return true;
Misha Brukman07218672002-11-22 22:44:32 +0000342}
343
Chris Lattner1d62cea2002-12-16 14:37:00 +0000344Pass *createSimpleRegisterAllocator(TargetMachine &TM) {
Misha Brukman07218672002-11-22 22:44:32 +0000345 return new RegAllocSimple(TM);
346}