summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/fold-vector-sext-crash.ll
blob: db73195698e3fad7fded8187e83f9ef4a67a366c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mcpu=core-avx-i -mtriple=i386-unknown-linux-gnu -mattr=+avx,+popcnt,+cmov | FileCheck %s

; Make sure that we don't introduce illegal build_vector dag nodes
; when trying to fold a sign_extend of a constant build_vector.
; After r200234 the test case below was crashing the compiler with an assertion failure
; due to an illegal build_vector of type MVT::v4i64.

define <4 x i64> @foo(<4 x i64> %A) {
; CHECK-LABEL: foo:
; CHECK:       # %bb.0:
; CHECK-NEXT:    vmovapd {{.*#+}} ymm1 = [4294967295,4294967295,4294967295,4294967295,0,0,0,0]
; CHECK-NEXT:    vxorpd %xmm2, %xmm2, %xmm2
; CHECK-NEXT:    vblendvpd %ymm1, %ymm0, %ymm2, %ymm0
; CHECK-NEXT:    retl
  %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>
  ret <4 x i64> %1
}