Index: lib/CodeGen/CGBuiltin.cpp =================================================================== --- lib/CodeGen/CGBuiltin.cpp +++ lib/CodeGen/CGBuiltin.cpp @@ -7919,6 +7919,11 @@ ID = Intrinsic::x86_sse_cmp_ps; break; case X86::BI__builtin_ia32_cmpps256: + if (CC == 0xf) { + Value *Vec = Builder.CreateVectorSplat(Ops[0]->getType()->getVectorNumElements(), + llvm::Constant::getAllOnesValue(Builder.getInt32Ty())); + return Builder.CreateBitCast(Vec, Ops[0]->getType()); + } ID = Intrinsic::x86_avx_cmp_ps_256; break; case X86::BI__builtin_ia32_cmppd: Index: test/CodeGen/avx-builtins.c =================================================================== --- test/CodeGen/avx-builtins.c +++ test/CodeGen/avx-builtins.c @@ -1427,3 +1427,9 @@ // CHECK: extractelement <8 x float> %{{.*}}, i32 0 return _mm256_cvtss_f32(__a); } + +__m256 test_mm256_cmp_ps_true(__m256 a, __m256 b) { + // CHECK-LABEL: @test_mm256_cmp_ps_true + // CHECK: store <8 x float>