Home | History | Annotate | Download | only in IndVarSimplify
      1 ; RUN: opt < %s -indvars
      2 ; PR4436
      3 
      4 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:32:32"
      5 target triple = "i386-pc-linux-gnu"
      6 
      7 define i8* @string_expandtabs(i32 %n, i8* %m) nounwind {
      8 entry:
      9 	br i1 undef, label %bb33, label %bb1
     10 
     11 bb1:		; preds = %entry
     12 	br i1 undef, label %overflow1, label %bb15
     13 
     14 bb15:		; preds = %bb1
     15 	br i1 undef, label %bb33, label %bb17
     16 
     17 bb17:		; preds = %bb15
     18 	br label %bb30
     19 
     20 bb19:		; preds = %bb30
     21 	br i1 undef, label %bb20, label %bb29
     22 
     23 bb20:		; preds = %bb19
     24 	%0 = load i32* undef, align 4		; <i32> [#uses=1]
     25 	%1 = sub i32 %0, %n		; <i32> [#uses=1]
     26 	br label %bb23
     27 
     28 bb21:		; preds = %bb23
     29 	%2 = icmp ult i8* %q.0, %m		; <i1> [#uses=1]
     30 	br i1 %2, label %bb22, label %overflow2
     31 
     32 bb22:		; preds = %bb21
     33 	%3 = getelementptr i8* %q.0, i32 1		; <i8*> [#uses=1]
     34 	br label %bb23
     35 
     36 bb23:		; preds = %bb22, %bb20
     37 	%i.2 = phi i32 [ %1, %bb20 ], [ %4, %bb22 ]		; <i32> [#uses=1]
     38 	%q.0 = phi i8* [ undef, %bb20 ], [ %3, %bb22 ]		; <i8*> [#uses=3]
     39 	%4 = add i32 %i.2, -1		; <i32> [#uses=2]
     40 	%5 = icmp eq i32 %4, -1		; <i1> [#uses=1]
     41 	br i1 %5, label %bb29, label %bb21
     42 
     43 bb29:		; preds = %bb23, %bb19
     44 	%q.1 = phi i8* [ undef, %bb19 ], [ %q.0, %bb23 ]		; <i8*> [#uses=0]
     45 	br label %bb30
     46 
     47 bb30:		; preds = %bb29, %bb17
     48 	br i1 undef, label %bb19, label %bb33
     49 
     50 overflow2:		; preds = %bb21
     51 	br i1 undef, label %bb32, label %overflow1
     52 
     53 bb32:		; preds = %overflow2
     54 	br label %overflow1
     55 
     56 overflow1:		; preds = %bb32, %overflow2, %bb1
     57 	ret i8* null
     58 
     59 bb33:		; preds = %bb30, %bb15, %entry
     60 	ret i8* undef
     61 }
     62