From 9bb1be2eecc888cccee7e9c9fc0ca48cf5d6339e Mon Sep 17 00:00:00 2001 From: Nate Begeman Date: Tue, 14 Jun 2005 03:55:23 +0000 Subject: [PATCH] Commit a small improvement that is already in the x86 and ia64 backends to not generate unnecessary register copies. This improves compile time by 2-5% depending on the test. llvm-svn: 22210 --- lib/Target/PowerPC/PPC32ISelPattern.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Target/PowerPC/PPC32ISelPattern.cpp b/lib/Target/PowerPC/PPC32ISelPattern.cpp index 750161caf8a..5b4c6e58d5c 100644 --- a/lib/Target/PowerPC/PPC32ISelPattern.cpp +++ b/lib/Target/PowerPC/PPC32ISelPattern.cpp @@ -1572,6 +1572,11 @@ unsigned ISel::SelectExpr(SDOperand N, bool Recording) { SDNode *Node = N.Val; MVT::ValueType DestType = N.getValueType(); + if (Node->getOpcode() == ISD::CopyFromReg && + MRegisterInfo::isVirtualRegister(cast(Node)->getReg())) + // Just use the specified register as our input. + return cast(Node)->getReg(); + unsigned &Reg = ExprMap[N]; if (Reg) return Reg;