Index: lib/CodeGen/SelectionDAG/DAGCombiner.cpp =================================================================== --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -16515,7 +16515,7 @@ TLI.isTypeLegal(Scalar->getOperand(0).getValueType())) Scalar = Scalar->getOperand(0); - EVT SclTy = Scalar->getValueType(0); + EVT SclTy = Scalar.getValueType(); if (!SclTy.isFloatingPoint() && !SclTy.isInteger()) return SDValue(); Index: test/CodeGen/X86/combine-concat-vectors.ll =================================================================== --- /dev/null +++ test/CodeGen/X86/combine-concat-vectors.ll @@ -0,0 +1,27 @@ +; RUN: llc -mtriple=x86_64-- -o - | FileCheck %s +; Check that this does not fail to combine concat_vectors of a value from +; merge_values through a bitcast. +define void @d() personality i8* undef { +entry: + %call16 = invoke { i8, double } undef() + to label %bar unwind label %foo + +foo: ; preds = %bar, %entry + %0 = landingpad { i8*, i32 } + cleanup + br label %bazr + +bar: ; preds = %entry + %1 = extractvalue { i8, double } %call16, 1 + %2 = bitcast double %1 to <2 x float> + invoke void undef() + to label %baz unwind label %foo + +baz: ; preds = %bar + %3 = extractelement <2 x float> %2, i64 0 + br label %bazr + +bazr: ; preds = %baz, %foo + %exn.obj = extractvalue { i8*, i32 } undef, 0 + unreachable +}