1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
3 ; With optimization at O2 we actually get the legalized function optimized
4 ; away through legalization and stack coloring, but check that we do all of
5 ; that here and don't crash during legalization.
8 ; typedef enum { A, B, C, D } P;
9 ; struct { P x[2]; } a;
19 ; b = a.x[c] == A || a.x[c] == B || a.x[c] == D;
30 ; CHECK: movb $0, {{.*}}(%rsp)
31 ; CHECK: cmpq $8, %rax
35 vector.body: ; preds = %vector.body, %for.cond
36 %x42 = bitcast <4 x i4> zeroinitializer to i16
37 %x43 = icmp ne i16 %x42, 0
38 %x44 = select i1 %x43, i32 undef, i32 0
39 %x72 = bitcast <4 x i1> zeroinitializer to i4
40 %x73 = icmp ne i4 %x72, 0
41 %x74 = select i1 %x73, i32 %x44, i32 undef
42 %x84 = select i1 undef, i32 undef, i32 %x74
43 %x88 = icmp eq i64 undef, 8
44 br i1 %x88, label %middle.block, label %vector.body
46 middle.block: ; preds = %vector.body
47 %0 = select i1 undef, i32 undef, i32 %x84