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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nate Begeman 2005-06-14 03:55:23 +00:00
parent 16b5644f04
commit a43b176f51

View File

@ -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<RegSDNode>(Node)->getReg()))
// Just use the specified register as our input.
return cast<RegSDNode>(Node)->getReg();
unsigned &Reg = ExprMap[N];
if (Reg) return Reg;