Index: lib/Target/PowerPC/PPCISelLowering.cpp =================================================================== --- lib/Target/PowerPC/PPCISelLowering.cpp +++ lib/Target/PowerPC/PPCISelLowering.cpp @@ -11920,10 +11920,8 @@ if (VT == MVT::v2i64) return Subtarget.hasDirectMove(); // Don't need stack ops with direct moves - if (Subtarget.hasQPX()) { - if (VT == MVT::v4f32 || VT == MVT::v4f64 || VT == MVT::v4i1) - return true; - } + if (Subtarget.hasVSX() || Subtarget.hasQPX()) + return true; return TargetLowering::shouldExpandBuildVectorWithShuffles(VT, DefinedValues); } Index: test/CodeGen/PowerPC/pr27078.ll =================================================================== --- test/CodeGen/PowerPC/pr27078.ll +++ test/CodeGen/PowerPC/pr27078.ll @@ -0,0 +1,15 @@ +; RUN: llc -mtriple=powerpc64-linux-gnu -mcpu=pwr8 -mattr=+vsx < %s | FileCheck %s + +define <4 x float> @bar(float* %p, float* %q) { + %1 = bitcast float* %p to <12 x float>* + %2 = bitcast float* %q to <12 x float>* + %3 = load <12 x float>, <12 x float>* %1, align 16 + %4 = load <12 x float>, <12 x float>* %2, align 16 + %5 = fsub <12 x float> %4, %3 + %6 = shufflevector <12 x float> %5, <12 x float> undef, <4 x i32> + ret <4 x float> %6 + +; CHECK: vspltw +; CHECK: vmrghw +; CHECK: vsldoi +}