[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 27 23:33:15 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCISelLowering.cpp updated: 1.74 -> 1.75
---
Log message:

Fix a bug in my elimination of ISD::CALL this morning.  PPC now has to
provide the expansion for i64 calls itself


---
Diffs of the changes:  (+9 -2)

 PPCISelLowering.cpp |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.74 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.75
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.74	Fri Jan 27 17:34:02 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp	Sat Jan 28 01:33:03 2006
@@ -173,6 +173,7 @@
   case PPCISD::SRL:           return "PPCISD::SRL";
   case PPCISD::SRA:           return "PPCISD::SRA";
   case PPCISD::SHL:           return "PPCISD::SHL";
+  case PPCISD::CALL:          return "PPCISD::CALL";
   case PPCISD::RET_FLAG:      return "PPCISD::RET_FLAG";
   }
 }
@@ -835,8 +836,12 @@
   if (RetTyVT >= MVT::i1 && RetTyVT <= MVT::i16)
     ActualRetTyVT = MVT::i32;   // Promote result to i32.
     
-  if (RetTyVT != MVT::isVoid)
+  if (RetTyVT == MVT::i64) {
+    RetVals.push_back(MVT::i32);
+    RetVals.push_back(MVT::i32);
+  } else if (RetTyVT != MVT::isVoid) {
     RetVals.push_back(ActualRetTyVT);
+  }
   RetVals.push_back(MVT::Other);
   
   // If the callee is a GlobalAddress node (quite common, every direct call is)
@@ -849,7 +854,7 @@
   Ops.push_back(Callee);
   Ops.insert(Ops.end(), args_to_use.begin(), args_to_use.end());
   SDOperand TheCall = DAG.getNode(PPCISD::CALL, RetVals, Ops);
-  Chain = TheCall.getValue(RetTyVT != MVT::isVoid);
+  Chain = TheCall.getValue(TheCall.Val->getNumValues()-1);
   Chain = DAG.getNode(ISD::CALLSEQ_END, MVT::Other, Chain,
                       DAG.getConstant(NumBytes, getPointerTy()));
   SDOperand RetVal = TheCall;
@@ -860,6 +865,8 @@
     RetVal = DAG.getNode(RetTy->isSigned() ? ISD::AssertSext : ISD::AssertZext,
                          MVT::i32, RetVal, DAG.getValueType(RetTyVT));
     RetVal = DAG.getNode(ISD::TRUNCATE, RetTyVT, RetVal);
+  } else if (RetTyVT == MVT::i64) {
+    RetVal = DAG.getNode(ISD::BUILD_PAIR, MVT::i64, RetVal, RetVal.getValue(1));
   }
   
   return std::make_pair(RetVal, Chain);






More information about the llvm-commits mailing list