1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s
4 ; With optimization at O2 we actually get the legalized function optimized
5 ; away through legalization and stack coloring, but check that we do all of
6 ; that here and don't crash during legalization.
9 ; typedef enum { A, B, C, D } P;
10 ; struct { P x[2]; } a;
20 ; b = a.x[c] == A || a.x[c] == B || a.x[c] == D;
29 define void @fn1(i64 %a0) {
31 ; CHECK: # %bb.0: # %for.cond
32 ; CHECK-NEXT: .p2align 4, 0x90
33 ; CHECK-NEXT: .LBB0_1: # %vector.body
34 ; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
35 ; CHECK-NEXT: cmpq $8, %rdi
36 ; CHECK-NEXT: jne .LBB0_1
37 ; CHECK-NEXT: # %bb.2: # %middle.block
42 vector.body: ; preds = %vector.body, %for.cond
43 %x42 = bitcast <4 x i4> zeroinitializer to i16
44 %x43 = icmp ne i16 %x42, 0
45 %x44 = select i1 %x43, i32 undef, i32 0
46 %x72 = bitcast <4 x i1> zeroinitializer to i4
47 %x73 = icmp ne i4 %x72, 0
48 %x74 = select i1 %x73, i32 %x44, i32 undef
49 %x84 = select i1 undef, i32 undef, i32 %x74
50 %x88 = icmp eq i64 %a0, 8
51 br i1 %x88, label %middle.block, label %vector.body
53 middle.block: ; preds = %vector.body
54 %0 = select i1 undef, i32 undef, i32 %x84