diff options
author | Michael Liao <michael.liao@intel.com> | 2012-08-20 17:59:18 +0000 |
---|---|---|
committer | Michael Liao <michael.liao@intel.com> | 2012-08-20 17:59:18 +0000 |
commit | 10ff96ce8c3307454bef4dbfdaeefde5a34bc7cf (patch) | |
tree | c7fb0596a412702d3b4e5dd715266c51db5af5a8 | |
parent | 11dfbe196ff7894615d5b57447ceb473f2a55750 (diff) | |
download | bcm5719-llvm-10ff96ce8c3307454bef4dbfdaeefde5a34bc7cf.tar.gz bcm5719-llvm-10ff96ce8c3307454bef4dbfdaeefde5a34bc7cf.zip |
fix a case where all operands of BUILD_VECTOR are undefined
llvm-svn: 162214
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/pr11334.ll | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index e4af736844b..1bbd4a76406 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -5180,6 +5180,10 @@ X86TargetLowering::LowerVectorFpExtend(SDValue &Op, SelectionDAG &DAG) const { Mask.push_back(cast<ConstantSDNode>(L2In.getOperand(1))->getZExtValue()); } + // Quit if all operands of BUILD_VECTOR are undefined. + if (!VecIn.getNode()) + return SDValue(); + // Fill the remaining mask as undef. for (unsigned i = NumElts; i < VecInVT.getVectorNumElements(); ++i) Mask.push_back(-1); diff --git a/llvm/test/CodeGen/X86/pr11334.ll b/llvm/test/CodeGen/X86/pr11334.ll index 5b7b5eab87e..e7e29e0d609 100644 --- a/llvm/test/CodeGen/X86/pr11334.ll +++ b/llvm/test/CodeGen/X86/pr11334.ll @@ -54,3 +54,11 @@ entry: %f1 = fpext <8 x float> %v1 to <8 x double> ret <8 x double> %f1 } + +define void @test_vector_creation() nounwind { + %1 = insertelement <4 x double> undef, double 0.000000e+00, i32 2 + %2 = load double addrspace(1)* null + %3 = insertelement <4 x double> %1, double %2, i32 3 + store <4 x double> %3, <4 x double>* undef + ret void +} |