Home | History | Annotate | Download | only in X86
      1 ; REQUIRES: asserts
      2 ; RUN: llc < %s -disable-preheader-prot=true  -stats 2>&1 | grep "Number of blocks eliminated" | grep 3
      3 ; RUN: llc < %s -disable-preheader-prot=true  -stats -cgp-freq-ratio-to-skip-merge=10 2>&1 | grep "Number of blocks eliminated" | grep 6
      4 ; RUN: llc < %s -disable-preheader-prot=false -stats 2>&1 | grep "Number of blocks eliminated" | grep 3
      5 ; PR1296
      6 
      7 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
      8 target triple = "i686-apple-darwin8"
      9 
     10 define i32 @foo(i32 %A, i32 %B, i32 %C) nounwind {
     11 entry:
     12 	switch i32 %A, label %out [
     13 		 i32 1, label %bb
     14 		 i32 0, label %bb13
     15 		 i32 2, label %bb35
     16 	]
     17 
     18 bb:		; preds = %cond_next, %entry
     19 	%i.144.1 = phi i32 [ 0, %entry ], [ %tmp7, %cond_next ]		; <i32> [#uses=2]
     20 	%tmp4 = and i32 %i.144.1, %B		; <i32> [#uses=1]
     21 	icmp eq i32 %tmp4, 0		; <i1>:0 [#uses=1]
     22 	br i1 %0, label %cond_next, label %out
     23 
     24 cond_next:		; preds = %bb
     25 	%tmp7 = add i32 %i.144.1, 1		; <i32> [#uses=2]
     26 	icmp slt i32 %tmp7, 1000		; <i1>:1 [#uses=1]
     27 	br i1 %1, label %bb, label %out
     28 
     29 bb13:		; preds = %cond_next18, %entry
     30 	%i.248.1 = phi i32 [ 0, %entry ], [ %tmp20, %cond_next18 ]		; <i32> [#uses=2]
     31 	%tmp16 = and i32 %i.248.1, %C		; <i32> [#uses=1]
     32 	icmp eq i32 %tmp16, 0		; <i1>:2 [#uses=1]
     33 	br i1 %2, label %cond_next18, label %out
     34 
     35 cond_next18:		; preds = %bb13
     36 	%tmp20 = add i32 %i.248.1, 1		; <i32> [#uses=2]
     37 	icmp slt i32 %tmp20, 1000		; <i1>:3 [#uses=1]
     38 	br i1 %3, label %bb13, label %out
     39 
     40 bb27:		; preds = %bb35
     41 	%tmp30 = and i32 %i.3, %C		; <i32> [#uses=1]
     42 	icmp eq i32 %tmp30, 0		; <i1>:4 [#uses=1]
     43 	br i1 %4, label %cond_next32, label %out
     44 
     45 cond_next32:		; preds = %bb27
     46 	%indvar.next = add i32 %i.3, 1		; <i32> [#uses=1]
     47 	br label %bb35
     48 
     49 bb35:		; preds = %entry, %cond_next32
     50 	%i.3 = phi i32 [ %indvar.next, %cond_next32 ], [ 0, %entry ]		; <i32> [#uses=3]
     51 	icmp slt i32 %i.3, 1000		; <i1>:5 [#uses=1]
     52 	br i1 %5, label %bb27, label %out
     53 
     54 out:		; preds = %bb27, %bb35, %bb13, %cond_next18, %bb, %cond_next, %entry
     55 	%result.0 = phi i32 [ 0, %entry ], [ 1, %bb ], [ 0, %cond_next ], [ 1, %bb13 ], [ 0, %cond_next18 ], [ 1, %bb27 ], [ 0, %bb35 ]		; <i32> [#uses=1]
     56 	ret i32 %result.0
     57 }
     58