1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

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
This commit is contained in:
Nate Begeman 2005-06-14 03:55:23 +00:00
parent 202eb6ff93
commit 9bb1be2eec

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;