aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-05 06:54:42 +0000
committerChris Lattner <sabre@nondot.org>2006-04-05 06:54:42 +0000
commit2e2ef9535070bb352601482cceac1140c1158cdd (patch)
treede02fe7c0675319bc63bdf3735299522c715b133 /lib/CodeGen
parent604fb320c3873f1256b4465a8e27ea0ba2711d32 (diff)
downloadexternal_llvm-2e2ef9535070bb352601482cceac1140c1158cdd.zip
external_llvm-2e2ef9535070bb352601482cceac1140c1158cdd.tar.gz
external_llvm-2e2ef9535070bb352601482cceac1140c1158cdd.tar.bz2
Make a vector live across blocks have the correct Vec type. This fixes
CodeGen/X86/2006-04-04-CrossBlockCrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27436 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-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 2f79fe5..4eb33c1 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -648,7 +648,8 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) {
// Otherwise, if this is a vector, make it available as a generic vector
// here.
MVT::ValueType PTyElementVT, PTyLegalElementVT;
- unsigned NE = TLI.getPackedTypeBreakdown(cast<PackedType>(VTy),PTyElementVT,
+ const PackedType *PTy = cast<PackedType>(VTy);
+ unsigned NE = TLI.getPackedTypeBreakdown(PTy, PTyElementVT,
PTyLegalElementVT);
// Build a VBUILD_VECTOR with the input registers.
@@ -684,6 +685,13 @@ SDOperand SelectionDAGLowering::getValue(const Value *V) {
Ops.push_back(DAG.getConstant(NE, MVT::i32));
Ops.push_back(DAG.getValueType(PTyLegalElementVT));
N = DAG.getNode(ISD::VBUILD_VECTOR, MVT::Vector, Ops);
+
+ // Finally, use a VBIT_CONVERT to make this available as the appropriate
+ // vector type.
+ N = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, N,
+ DAG.getConstant(PTy->getNumElements(),
+ MVT::i32),
+ DAG.getValueType(TLI.getValueType(PTy->getElementType())));
}
return N;