aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-06-07 21:07:15 +0000
committerDale Johannesen <dalej@apple.com>2007-06-07 21:07:15 +0000
commit62000eee7de696cad5e3a307de395c77a61350ee (patch)
treeb82a3ca3d19c69e860ab7678be4686e8ad379b16 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parenta97e040e05f035f0ecbd2afeee3d21a41ef5ad53 (diff)
Do not change the size of function arguments. PR 1489.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index ac89b179e1..f97ee72151 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -3993,7 +3993,15 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
Op = DAG.getNode(ExtOp, getTypeToTransformTo(VT), Op);
} else {
assert(MVT::isFloatingPoint(VT) && "Not int or FP?");
- Op = DAG.getNode(ISD::FP_EXTEND, getTypeToTransformTo(VT), Op);
+ // A true promotion would change the size of the argument.
+ // Instead, pretend this is an int. If FP objects are not
+ // passed the same as ints, the original type should be Legal
+ // and we should not get here.
+ Op = DAG.getNode(ISD::BIT_CONVERT,
+ VT==MVT::f32 ? MVT::i32 :
+ (VT==MVT::f64 ? MVT::i64 :
+ MVT::Other),
+ Op);
}
Ops.push_back(Op);
Ops.push_back(DAG.getConstant(Flags, MVT::i32));