[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaISelPattern.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue Apr 12 10:35:32 PDT 2005



Changes in directory llvm/lib/Target/Alpha:

AlphaISelPattern.cpp updated: 1.91 -> 1.92
---
Log message:

Get rid of idefs for arguments

---
Diffs of the changes:  (+28 -5)

 AlphaISelPattern.cpp |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaISelPattern.cpp
diff -u llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.91 llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.92
--- llvm/lib/Target/Alpha/AlphaISelPattern.cpp:1.91	Fri Apr  8 22:22:22 2005
+++ llvm/lib/Target/Alpha/AlphaISelPattern.cpp	Tue Apr 12 12:35:16 2005
@@ -170,20 +170,25 @@
     for (int i = 0; i < 6; ++i)
     {
       if (F.isVarArg()) {
-        BuildMI(&BB, Alpha::IDEF, 0, args_int[i]);
-        BuildMI(&BB, Alpha::IDEF, 0, args_float[i]);
+        F->addLiveIn(args_int[i]);
+        F->addLiveIn(args_float[i]);
+//        BuildMI(&BB, Alpha::IDEF, 0, args_int[i]);
+//        BuildMI(&BB, Alpha::IDEF, 0, args_float[i]);
       } else if (I != E)
       {
         if(MVT::isInteger(getValueType(I->getType())))
-          BuildMI(&BB, Alpha::IDEF, 0, args_int[i]);
+          F->addLiveIn(args_int[i]);
+//          BuildMI(&BB, Alpha::IDEF, 0, args_int[i]);
         else
-          BuildMI(&BB, Alpha::IDEF, 0, args_float[i]);
+          F->addLiveIn(args_float[i]);
+//          BuildMI(&BB, Alpha::IDEF, 0, args_float[i]);
         ++I;
       }
     }
   }
 
-  BuildMI(&BB, Alpha::IDEF, 0, Alpha::R29);
+  F->addLiveIn(Alpha::R29);
+//  BuildMI(&BB, Alpha::IDEF, 0, Alpha::R29);
   BuildMI(&BB, Alpha::BIS, 2, GP).addReg(Alpha::R29).addReg(Alpha::R29);
 
   for (Function::arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I)
@@ -257,6 +262,24 @@
 
   //Set up a token factor with all the stack traffic
   DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, LS));
+
+  // Finally, inform the code generator which regs we return values in.
+  switch (getValueType(F.getReturnType())) {
+  default: assert(0 && "Unknown type!");
+  case MVT::isVoid: break;
+  case MVT::i1:
+  case MVT::i8:
+  case MVT::i16:
+  case MVT::i32:
+  case MVT::i64:
+    MF.addLiveOut(Alpha::R0);
+    break;
+  case MVT::f32:
+  case MVT::f64:
+    MF.addLiveOut(Alpha::F0);
+    break;
+  }
+
   //return the arguments
   return ArgValues;
 }






More information about the llvm-commits mailing list