Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: opt < %s -loop-vectorize -S | FileCheck %s
      2 
      3 ; CHECK: fadd
      4 ; CHECK-NEXT: fadd
      5 ; CHECK-NEXT: fadd
      6 ; CHECK-NEXT: fadd
      7 ; CHECK-NEXT: fadd
      8 ; CHECK-NEXT: fadd
      9 ; CHECK-NEXT: fadd
     10 ; CHECK-NEXT: fadd
     11 ; CHECK-NEXT: fadd
     12 ; CHECK-NEXT: fadd
     13 ; CHECK-NEXT: fadd
     14 ; CHECK-NEXT: fadd
     15 ; CHECK-NEXT-NOT: fadd
     16 
     17 target datalayout = "e-m:e-i64:64-n32:64"
     18 target triple = "powerpc64le-ibm-linux-gnu"
     19 
     20 define void @test(double* nocapture readonly %arr, i32 signext %len) #0 {
     21 entry:
     22   %cmp4 = icmp sgt i32 %len, 0
     23   br i1 %cmp4, label %for.body.lr.ph, label %for.end
     24 
     25 for.body.lr.ph:                                   ; preds = %entry
     26   %0 = add i32 %len, -1
     27   br label %for.body
     28 
     29 for.body:                                         ; preds = %for.body, %for.body.lr.ph
     30   %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
     31   %redx.05 = phi double [ 0.000000e+00, %for.body.lr.ph ], [ %add, %for.body ]
     32   %arrayidx = getelementptr inbounds double, double* %arr, i64 %indvars.iv
     33   %1 = load double, double* %arrayidx, align 8
     34   %add = fadd fast double %1, %redx.05
     35   %indvars.iv.next = add i64 %indvars.iv, 1
     36   %lftr.wideiv = trunc i64 %indvars.iv to i32
     37   %exitcond = icmp eq i32 %lftr.wideiv, %0
     38   br i1 %exitcond, label %for.end.loopexit, label %for.body
     39 
     40 for.end.loopexit:                                 ; preds = %for.body
     41   %add.lcssa = phi double [ %add, %for.body ]
     42   br label %for.end
     43 
     44 for.end:                                          ; preds = %for.end.loopexit, %entry
     45   %redx.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa, %for.end.loopexit ]
     46   ret void
     47 }
     48