Home | History | Annotate | Download | only in JumpThreading
      1 ; RUN: opt < %s -jump-threading -loop-rotate -instcombine -indvars -loop-unroll -simplifycfg -S -verify-dom-info -verify-loop-info > %t
      2 ; RUN: grep {volatile store} %t | count 3
      3 ; RUN: not grep {br label} %t
      4 
      5 ; Jump threading should not prevent this loop from being unrolled.
      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-f80:128:128"
      8 target triple = "i386-apple-darwin9.6"
      9 @v1 = external global i32		; <i32*> [#uses=2]
     10 
     11 define i32 @unroll() nounwind {
     12 entry:
     13 	br label %bb4
     14 
     15 bb:		; preds = %bb4
     16 	%0 = icmp eq i32 %i.0, 0		; <i1> [#uses=1]
     17 	br i1 %0, label %bb1, label %bb2
     18 
     19 bb1:		; preds = %bb
     20 	volatile store i32 1000, i32* @v1, align 4
     21 	br label %bb3
     22 
     23 bb2:		; preds = %bb
     24 	volatile store i32 1001, i32* @v1, align 4
     25 	br label %bb3
     26 
     27 bb3:		; preds = %bb2, %bb1
     28 	%1 = add i32 %i.0, 1		; <i32> [#uses=1]
     29 	br label %bb4
     30 
     31 bb4:		; preds = %bb3, %entry
     32 	%i.0 = phi i32 [ 0, %entry ], [ %1, %bb3 ]		; <i32> [#uses=3]
     33 	%2 = icmp sgt i32 %i.0, 2		; <i1> [#uses=1]
     34 	br i1 %2, label %bb5, label %bb
     35 
     36 bb5:		; preds = %bb4
     37 	ret i32 0
     38 }
     39