This should always be signed chars, so use int8_t. This fixes a miscompile when
[llvm/stm8.git] / test / CodeGen / X86 / 2010-07-02-UnfoldBug.ll
blob79219dcfe60a5f2369c46a1cedcff569b93c417f
1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin
2 ; rdar://8154265
4 declare <4 x float> @llvm.x86.sse.max.ss(<4 x float>, <4 x float>) nounwind readnone
6 declare <4 x float> @llvm.x86.sse.min.ss(<4 x float>, <4 x float>) nounwind readnone
8 define void @_ZN2CA3OGL20fill_surface_mesh_3dERNS0_7ContextEPKNS_6Render13MeshTransformEPKNS0_5LayerEPNS0_7SurfaceEfNS0_13TextureFilterESC_f() nounwind optsize ssp {
9 entry:
10   br i1 undef, label %bb2.thread, label %bb2
12 bb2.thread:                                       ; preds = %entry
13   br i1 undef, label %bb41, label %bb10.preheader
15 bb2:                                              ; preds = %entry
16   unreachable
18 bb10.preheader:                                   ; preds = %bb2.thread
19   br i1 undef, label %bb9, label %bb12
21 bb9:                                              ; preds = %bb9, %bb10.preheader
22   br i1 undef, label %bb9, label %bb12
24 bb12:                                             ; preds = %bb9, %bb10.preheader
25   br i1 undef, label %bb4.i.i, label %bb3.i.i
27 bb3.i.i:                                          ; preds = %bb12
28   unreachable
30 bb4.i.i:                                          ; preds = %bb12
31   br i1 undef, label %bb8.i.i, label %_ZN2CA3OGL12_GLOBAL__N_16LightsC1ERNS0_7ContextEPKNS0_5LayerEPKNS_6Render13MeshTransformERKNS_4Vec3IfEESF_.exit
33 bb8.i.i:                                          ; preds = %bb4.i.i
34   br i1 undef, label %_ZN2CA3OGL12_GLOBAL__N_16LightsC1ERNS0_7ContextEPKNS0_5LayerEPKNS_6Render13MeshTransformERKNS_4Vec3IfEESF_.exit, label %bb9.i.i
36 bb9.i.i:                                          ; preds = %bb8.i.i
37   br i1 undef, label %bb11.i.i, label %bb10.i.i
39 bb10.i.i:                                         ; preds = %bb9.i.i
40   unreachable
42 bb11.i.i:                                         ; preds = %bb9.i.i
43   unreachable
45 _ZN2CA3OGL12_GLOBAL__N_16LightsC1ERNS0_7ContextEPKNS0_5LayerEPKNS_6Render13MeshTransformERKNS_4Vec3IfEESF_.exit: ; preds = %bb8.i.i, %bb4.i.i
46   br i1 undef, label %bb19, label %bb14
48 bb14:                                             ; preds = %_ZN2CA3OGL12_GLOBAL__N_16LightsC1ERNS0_7ContextEPKNS0_5LayerEPKNS_6Render13MeshTransformERKNS_4Vec3IfEESF_.exit
49   unreachable
51 bb19:                                             ; preds = %_ZN2CA3OGL12_GLOBAL__N_16LightsC1ERNS0_7ContextEPKNS0_5LayerEPKNS_6Render13MeshTransformERKNS_4Vec3IfEESF_.exit
52   br i1 undef, label %bb.i50, label %bb6.i
54 bb.i50:                                           ; preds = %bb19
55   unreachable
57 bb6.i:                                            ; preds = %bb19
58   br i1 undef, label %bb28, label %bb.nph106
60 bb22:                                             ; preds = %bb24.preheader
61   br i1 undef, label %bb2.i.i, label %bb.i.i49
63 bb.i.i49:                                         ; preds = %bb22
64   %0 = load float* undef, align 4                 ; <float> [#uses=1]
65   %1 = insertelement <4 x float> undef, float %0, i32 0 ; <<4 x float>> [#uses=1]
66   %2 = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> <float 1.000000e+00, float undef, float undef, float undef>, <4 x float> %1) nounwind readnone ; <<4 x float>> [#uses=1]
67   %3 = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %2, <4 x float> <float 0.000000e+00, float undef, float undef, float undef>) nounwind readnone ; <<4 x float>> [#uses=1]
68   %4 = extractelement <4 x float> %3, i32 0       ; <float> [#uses=1]
69   store float %4, float* undef, align 4
70   %5 = call <4 x float> @llvm.x86.sse.min.ss(<4 x float> <float 1.000000e+00, float undef, float undef, float undef>, <4 x float> undef) nounwind readnone ; <<4 x float>> [#uses=1]
71   %6 = call <4 x float> @llvm.x86.sse.max.ss(<4 x float> %5, <4 x float> <float 0.000000e+00, float undef, float undef, float undef>) nounwind readnone ; <<4 x float>> [#uses=1]
72   %7 = extractelement <4 x float> %6, i32 0       ; <float> [#uses=1]
73   store float %7, float* undef, align 4
74   unreachable
76 bb2.i.i:                                          ; preds = %bb22
77   unreachable
79 bb26.loopexit:                                    ; preds = %bb24.preheader
80   br i1 undef, label %bb28, label %bb24.preheader
82 bb.nph106:                                        ; preds = %bb6.i
83   br label %bb24.preheader
85 bb24.preheader:                                   ; preds = %bb.nph106, %bb26.loopexit
86   br i1 undef, label %bb22, label %bb26.loopexit
88 bb28:                                             ; preds = %bb26.loopexit, %bb6.i
89   unreachable
91 bb41:                                             ; preds = %bb2.thread
92   br i1 undef, label %return, label %bb46
94 bb46:                                             ; preds = %bb41
95   ret void
97 return:                                           ; preds = %bb41
98   ret void