Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt -instcombine -S < %s | FileCheck %s
      2 ; Radar 10803727
      3 @.str = private unnamed_addr constant [35 x i8] c"\0Ain_range input (should be 0): %f\0A\00", align 1
      4 @.str1 = external hidden unnamed_addr constant [35 x i8], align 1
      5 
      6 declare i32 @printf(i8*, ...)
      7 define i64 @_Z8tempCastj(i32 %val) uwtable ssp {
      8 entry:
      9   %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8]* @.str1, i64 0, i64 0), i32 %val)
     10   %conv = uitofp i32 %val to double
     11   %call.i = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8]* @.str, i64 0, i64 0), double %conv)
     12   %cmp.i = fcmp oge double %conv, -1.000000e+00
     13   br i1 %cmp.i, label %land.rhs.i, label %if.end.critedge
     14 ; CHECK:  br i1 true, label %land.rhs.i, label %if.end.critedge
     15 
     16 land.rhs.i:                                       ; preds = %entry
     17   %cmp1.i = fcmp olt double %conv, 1.000000e+00
     18   br i1 %cmp1.i, label %if.then, label %if.end
     19 
     20 if.then:                                          ; preds = %land.rhs.i
     21   %add = fadd double %conv, 5.000000e-01
     22   %conv3 = fptosi double %add to i64
     23   br label %return
     24 
     25 if.end.critedge:                                  ; preds = %entry
     26   br label %if.end
     27 
     28 if.end:                                           ; preds = %if.end.critedge, %land.rhs.i
     29   br label %return
     30 
     31 return:                                           ; preds = %if.end, %if.then
     32   %retval.0 = phi i64 [ %conv3, %if.then ], [ -1, %if.end ]
     33   ret i64 %retval.0
     34 }
     35 
     36