[PowerPC] Recommit r314244 with refactoring and off by default
[llvm-core.git] / test / CodeGen / X86 / fold-vector-sext-crash.ll
blob6928a3ea941261bd5729e09fef2e728af1580f87
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mcpu=core-avx-i -mtriple=i386-unknown-linux-gnu -mattr=+avx,+popcnt,+cmov | FileCheck %s
4 ; Make sure that we don't introduce illegal build_vector dag nodes
5 ; when trying to fold a sign_extend of a constant build_vector.
6 ; After r200234 the test case below was crashing the compiler with an assertion failure
7 ; due to an illegal build_vector of type MVT::v4i64.
9 define <4 x i64> @foo(<4 x i64> %A) {
10 ; CHECK-LABEL: foo:
11 ; CHECK:       # BB#0:
12 ; CHECK-NEXT:    vpcmpeqd %xmm1, %xmm1, %xmm1
13 ; CHECK-NEXT:    vmovdqa %xmm1, %xmm1
14 ; CHECK-NEXT:    vandps %ymm0, %ymm1, %ymm0
15 ; CHECK-NEXT:    retl
16   %1 = select <4 x i1> <i1 true, i1 true, i1 false, i1 false>, <4 x i64> %A, <4 x i64><i64 undef, i64 undef, i64 0, i64 0>
17   ret <4 x i64> %1