summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-17 20:49:36 +0000
committerChris Lattner <sabre@nondot.org>2006-05-17 20:49:36 +0000
commitd202ca4d988b5ee3f30656a7e82443db4752dd91 (patch)
treee4507a615dc3efb4e9c46de233631bc869b88531 /lib/CodeGen/SelectionDAG
parent1b8daae71b0118b489cbecf2f1b8ed86b6bc8e57 (diff)
downloadllvm-d202ca4d988b5ee3f30656a7e82443db4752dd91.tar.gz
llvm-d202ca4d988b5ee3f30656a7e82443db4752dd91.tar.bz2
llvm-d202ca4d988b5ee3f30656a7e82443db4752dd91.tar.xz
Fix the result of the call to use a correct vbitconvert. There is no need to
use getPackedTypeBreakdown at all here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 517b760854..e88b371baf 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -2455,25 +2455,15 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
// Figure out if there is a Packed type corresponding to this Vector
// type. If so, convert to the packed type.
- bool Supported = false;
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
- if (TVT != MVT::Other) {
+ if (TVT != MVT::Other && isTypeLegal(TVT)) {
SDOperand N = SDOperand(Result, i++);
// Handle copies from generic vectors to registers.
- MVT::ValueType PTyElementVT, PTyLegalElementVT;
- unsigned NE = getPackedTypeBreakdown(PTy, PTyElementVT,
- PTyLegalElementVT);
- // FIXME: handle NE > 1 cases.
- if (NE == 1) {
- N = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, N,
- DAG.getConstant(NumElems, MVT::i32),
- DAG.getValueType(getValueType(EltTy)));
- Ops.push_back(N);
- Supported = true;
- }
- }
-
- if (!Supported) {
+ N = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, N,
+ DAG.getConstant(NumElems, MVT::i32),
+ DAG.getValueType(getValueType(EltTy)));
+ Ops.push_back(N);
+ } else {
assert(0 && "Don't support illegal by-val vector arguments yet!");
abort();
}
@@ -2633,16 +2623,11 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy, bool isVarArg,
// type. If so, convert to the packed type.
MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
if (TVT != MVT::Other && isTypeLegal(TVT)) {
- // Handle copies from generic vectors to registers.
- MVT::ValueType PTyElementVT, PTyLegalElementVT;
- unsigned NE = getPackedTypeBreakdown(cast<PackedType>(RetTy),
- PTyElementVT,
- PTyLegalElementVT);
// Insert a VBIT_CONVERT of the FORMAL_ARGUMENTS to a
// "N x PTyElementVT" MVT::Vector type.
ResVal = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, ResVal,
- DAG.getConstant(NE, MVT::i32),
- DAG.getValueType(PTyElementVT));
+ DAG.getConstant(NumElems, MVT::i32),
+ DAG.getValueType(getValueType(EltTy)));
} else {
abort();
}