summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
diff options
context:
space:
mode:
authorRichard Pennington <rich@pennware.com>2009-02-21 19:11:18 +0000
committerRichard Pennington <rich@pennware.com>2009-02-21 19:11:18 +0000
commit278f83daebd1d2072a4ce6892fa3481db5cdefbe (patch)
treede3c7775b960c09436a932078b10e08ab0ead862 /lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
parent07bf7efa0ac1f7ca8ca57a675dd8c6e2c52df73a (diff)
downloadllvm-278f83daebd1d2072a4ce6892fa3481db5cdefbe.tar.gz
llvm-278f83daebd1d2072a4ce6892fa3481db5cdefbe.tar.bz2
llvm-278f83daebd1d2072a4ce6892fa3481db5cdefbe.tar.xz
bug 3610: Floating point vaarg not softened.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index e203b1bcd4..ce312ae8c8 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/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();