ok, the "ia64 has a boatload of registers" joke stopped being funny today ;)
authorDuraid Madina <duraid@octopus.com.au>
Sat, 9 Apr 2005 11:53:00 +0000 (11:53 +0000)
committerDuraid Madina <duraid@octopus.com.au>
Sat, 9 Apr 2005 11:53:00 +0000 (11:53 +0000)
  * fix overallocation of integer (stacked) registers: we can't allocate
  registers for local use if they are required as output registers

this fixes 'toast' in the test suite, and all sorts of larger programs
like bzip2 etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/IA64/IA64RegisterInfo.td

index 148ecb7eb3e2b28d2232778d120585bcb0a32afe..8a9032c548e2c81d03b99902e793d7791386e2ea 100644 (file)
@@ -254,7 +254,12 @@ def GR : RegisterClass<i64, 64,
   {
     let Methods = [{
       iterator allocation_order_end(MachineFunction &MF) const {
-       return end()-7; // 7 special registers
+       int numReservedRegs=7; // the 7 special registers r0,r1,r2,r12,r13 etc
+       // we also can't allocate registers for use as locals if they're
+       // already required as 'out' registers
+       numReservedRegs+=MF.getInfo<IA64FunctionInfo>()->outRegsUsed;
+       
+       return end()-numReservedRegs; // hide registers appropriately
       }
   }];
 }