allow R28 to be used for frame calculations without entirely removing it from circulation
authorAndrew Lenharth <andrewl@lenharth.org>
Thu, 26 Jan 2006 03:22:07 +0000 (03:22 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Thu, 26 Jan 2006 03:22:07 +0000 (03:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25639 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Alpha/AlphaInstrFormats.td
lib/Target/Alpha/AlphaInstrInfo.td
lib/Target/Alpha/AlphaRegisterInfo.cpp

index 88a405c509b86488fcfc3886a1887a3208d62164..ac5481aed6c05eb7f6d6da3dcec0d211de1fb3ae 100644 (file)
@@ -45,6 +45,7 @@ class MForm<bits<6> opcode, bit store, bit load, string asmstr, list<dag> patter
   let Pattern = pattern;
   let isStore = store;
   let isLoad = load;
+  let Defs = [R28]; //We may use this for frame index calculations, so reserve it here
 
   bits<5> Ra;
   bits<16> disp;
@@ -54,16 +55,7 @@ class MForm<bits<6> opcode, bit store, bit load, string asmstr, list<dag> patter
   let Inst{20-16} = Rb;
   let Inst{15-0} = disp;
 }
-class MFormAlt<bits<6> opcode, string asmstr> 
-        : InstAlphaAlt<opcode, asmstr> {
-  bits<5> Ra;
-  bits<16> disp;
-  bits<5> Rb;
 
-  let Inst{25-21} = Ra;
-  let Inst{20-16} = Rb;
-  let Inst{15-0} = disp;
-}
 class MfcForm<bits<6> opcode, bits<16> fc, string asmstr> 
         : InstAlpha<opcode, (ops GPRC:$RA), asmstr> {
   bits<5> Ra;
@@ -85,15 +77,6 @@ class MbrForm<bits<6> opcode, bits<2> TB, dag OL, string asmstr> : InstAlpha<opc
 }
 
 //3.3.2
-let isBranch = 1, isTerminator = 1 in
-class BForm<bits<6> opcode, string asmstr> 
-    : InstAlpha<opcode, (ops GPRC:$RA, s21imm:$DISP), asmstr> {
-  bits<5> Ra;
-  bits<21> disp;
-
-  let Inst{25-21} = Ra;
-  let Inst{20-0} = disp;
-}
 def target : Operand<OtherVT> {}
 let isBranch = 1, isTerminator = 1 in
 class BFormD<bits<6> opcode, string asmstr, list<dag> pattern> 
index 61342979dedae718944372635f337587efc32d13..fa0310fcd11fad241dae49105a404f534462d220 100644 (file)
@@ -576,8 +576,8 @@ def : Pat<(truncstore GPRC:$DATA, GPRC:$addr, i8),
 
 //load address, rellocated gpdist form
 let OperandList = (ops GPRC:$RA, s16imm:$DISP, GPRC:$RB, s16imm:$NUM) in {
-def LDAg : MFormAlt<0x08,  "lda $RA,0($RB)\t\t!gpdisp!$NUM">;  //Load address
-def LDAHg : MFormAlt<0x09, "ldah $RA,0($RB)\t\t!gpdisp!$NUM">;  //Load address
+def LDAg  : MForm<0x08, 0, 1, "lda $RA,0($RB)\t\t!gpdisp!$NUM", []>;  //Load address
+def LDAHg : MForm<0x09, 0, 1, "ldah $RA,0($RB)\t\t!gpdisp!$NUM", []>;  //Load address
 }
 
 //Load quad, rellocated literal form
index fb93922aec51637a6d3a313faa6e798e694246d1..7bf9bd7c28adf4f2cd6d26669bb411ac2721caf1 100644 (file)
@@ -257,7 +257,7 @@ AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II) const {
         " for stack size: " << MF.getFrameInfo()->getStackSize() << "\n");
 
   if (Offset > IMM_HIGH || Offset < IMM_LOW) {
-    std::cerr << "Unconditionally using R28 for evil purposes\n";
+    DEBUG(std::cerr << "Unconditionally using R28 for evil purposes Offset: " << Offset << "\n");
     //so in this case, we need to use a temporary register, and move the original
     //inst off the SP/FP
     //fix up the old: