diff options
| author | Richard Pennington <rich@pennware.com> | 2009-02-21 19:11:18 +0000 |
|---|---|---|
| committer | Richard Pennington <rich@pennware.com> | 2009-02-21 19:11:18 +0000 |
| commit | 99f6d7c9fc46f0b74f1da0cd2336e33cd6c437e1 (patch) | |
| tree | 7c4aedf556a9ee11f6f60e0f665cde88d83ce3e0 /llvm/lib/CodeGen | |
| parent | 2300ad57a0115a5f733b813e8a2e259f1dc302af (diff) | |
| download | bcm5719-llvm-99f6d7c9fc46f0b74f1da0cd2336e33cd6c437e1.tar.gz bcm5719-llvm-99f6d7c9fc46f0b74f1da0cd2336e33cd6c437e1.zip | |
bug 3610: Floating point vaarg not softened.
llvm-svn: 65239
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 17 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp index e203b1bcd4a..ce312ae8c86 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp @@ -88,6 +88,7 @@ void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) { case ISD::SELECT_CC: R = SoftenFloatRes_SELECT_CC(N); break; case ISD::SINT_TO_FP: case ISD::UINT_TO_FP: R = SoftenFloatRes_XINT_TO_FP(N); break; + case ISD::VAARG: R = SoftenFloatRes_VAARG(N); break; } // If R is null, the sub-method took care of registering the result. @@ -454,6 +455,22 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT_CC(SDNode *N) { N->getOperand(1), LHS, RHS, N->getOperand(4)); } +SDValue DAGTypeLegalizer::SoftenFloatRes_VAARG(SDNode *N) { + SDValue Chain = N->getOperand(0); // Get the chain. + SDValue Ptr = N->getOperand(1); // Get the pointer. + MVT VT = N->getValueType(0); + MVT NVT = TLI.getTypeToTransformTo(VT); + DebugLoc dl = N->getDebugLoc(); + + SDValue NewVAARG; + NewVAARG = DAG.getVAArg(NVT, dl, Chain, Ptr, N->getOperand(2)); + + // Legalized the chain result - switch anything that used the old chain to + // use the new one. + ReplaceValueWith(SDValue(N, 1), NewVAARG.getValue(1)); + return NewVAARG; +} + SDValue DAGTypeLegalizer::SoftenFloatRes_XINT_TO_FP(SDNode *N) { bool Signed = N->getOpcode() == ISD::SINT_TO_FP; MVT SVT = N->getOperand(0).getValueType(); diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h index 6d66c974ef6..4228f560bdd 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h @@ -417,6 +417,7 @@ private: SDValue SoftenFloatRes_LOAD(SDNode *N); SDValue SoftenFloatRes_SELECT(SDNode *N); SDValue SoftenFloatRes_SELECT_CC(SDNode *N); + SDValue SoftenFloatRes_VAARG(SDNode *N); SDValue SoftenFloatRes_XINT_TO_FP(SDNode *N); // Operand Float to Integer Conversion. |

