Eliminate an extra copy from R1 that Nate noticed on function calls that
authorChris Lattner <sabre@nondot.org>
Thu, 28 Jul 2005 05:23:43 +0000 (05:23 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 28 Jul 2005 05:23:43 +0000 (05:23 +0000)
have to write arguments to the stack

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

lib/Target/PowerPC/PPCISelPattern.cpp

index efdb8b5b28940ff4943d51458f15507b976dfcea..c544e4d7fd01e71973c6f3776c4eb4d9370062a7 100644 (file)
@@ -1293,7 +1293,8 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) {
   MVT::ValueType DestType = N.getValueType();
 
   if (Node->getOpcode() == ISD::CopyFromReg &&
-      MRegisterInfo::isVirtualRegister(cast<RegSDNode>(Node)->getReg()))
+      (MRegisterInfo::isVirtualRegister(cast<RegSDNode>(Node)->getReg()) ||
+       cast<RegSDNode>(Node)->getReg() == PPC::R1))
     // Just use the specified register as our input.
     return cast<RegSDNode>(Node)->getReg();