Home | History | Annotate | Download | only in LICM
      1 ; RUN: opt < %s -basicaa -licm -S | FileCheck %s
      2 
      3 @a = external constant float*
      4 
      5 define void @test(i32 %count) {
      6 entry:
      7         br label %forcond
      8 
      9 ; CHECK:  %tmp3 = load float** @a
     10 ; CHECK:  br label %forcond
     11 
     12 forcond:
     13         %i.0 = phi i32 [ 0, %entry ], [ %inc, %forbody ]
     14         %cmp = icmp ult i32 %i.0, %count
     15         br i1 %cmp, label %forbody, label %afterfor
     16 
     17 ; CHECK:  %i.0 = phi i32 [ 0, %entry ], [ %inc, %forbody ]
     18 ; CHECK:  %cmp = icmp ult i32 %i.0, %count
     19 ; CHECK:  br i1 %cmp, label %forbody, label %afterfor
     20 
     21 forbody:
     22         %tmp3 = load float** @a
     23         %arrayidx = getelementptr float* %tmp3, i32 %i.0
     24         %tmp7 = uitofp i32 %i.0 to float
     25         store float %tmp7, float* %arrayidx
     26         %inc = add i32 %i.0, 1
     27         br label %forcond
     28 
     29 ; CHECK:  %arrayidx = getelementptr float* %tmp3, i32 %i.0
     30 ; CHECK:  %tmp7 = uitofp i32 %i.0 to float
     31 ; CHECK:  store float %tmp7, float* %arrayidx
     32 ; CHECK:  %inc = add i32 %i.0, 1
     33 ; CHECK:  br label %forcond
     34 
     35 afterfor:
     36         ret void
     37 }
     38 
     39 ; CHECK:  ret void
     40