diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-28 06:27:38 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-28 06:27:38 +0000 |
| commit | 13c184de29c09294ed63b01ac43e1b46c049278e (patch) | |
| tree | 39dd360f82112379482ae2385b6b9c7ef882b0d2 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
| parent | 1fe848ed2e41ae3043630457067d348486d8ad2e (diff) | |
CopyFromReg produces two values. Make sure that we remember that both are
legalized, and actually return the correct result when we legalize the chain first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 74f1c5526a..b48c1b6aab 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -206,7 +206,14 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { if (Tmp1 != Node->getOperand(0)) Result = DAG.getCopyFromReg(cast<RegSDNode>(Node)->getReg(), Node->getValueType(0), Tmp1); - break; + else + Result = Op.getValue(0); + + // Since CopyFromReg produces two values, make sure to remember that we + // legalized both of them. + AddLegalizedOperand(Op.getValue(0), Result); + AddLegalizedOperand(Op.getValue(1), Result.getValue(1)); + return Result.getValue(Op.ResNo); case ISD::ImplicitDef: Tmp1 = LegalizeOp(Node->getOperand(0)); if (Tmp1 != Node->getOperand(0)) |
