Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc < %s | FileCheck %s
      2 target datalayout = "E-m:e-p:32:32-i128:64-n32"
      3 target triple = "powerpc-ellcc-linux"
      4 
      5 ; Function Attrs: nounwind
      6 define void @foo1(i128* %a, i128* readonly %b, i128* readonly %c) #0 {
      7 entry:
      8   br label %for.body
      9 
     10 for.body:                                         ; preds = %for.body, %entry
     11   %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
     12   %0 = load i128* %b, align 16
     13   %1 = load i128* %c, align 16
     14   %shl = shl i128 %0, %1
     15   store i128 %shl, i128* %a, align 16
     16   %inc = add nsw i32 %i.02, 1
     17   %exitcond = icmp eq i32 %inc, 2048
     18   br i1 %exitcond, label %for.end, label %for.body
     19 
     20 for.end:                                          ; preds = %for.body
     21   ret void
     22 
     23 ; CHECK-LABEL: @foo1
     24 ; CHECK-NOT: mtctr
     25 }
     26 
     27 ; Function Attrs: nounwind
     28 define void @foo2(i128* %a, i128* readonly %b, i128* readonly %c) #0 {
     29 entry:
     30   br label %for.body
     31 
     32 for.body:                                         ; preds = %for.body, %entry
     33   %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
     34   %0 = load i128* %b, align 16
     35   %1 = load i128* %c, align 16
     36   %shl = ashr i128 %0, %1
     37   store i128 %shl, i128* %a, align 16
     38   %inc = add nsw i32 %i.02, 1
     39   %exitcond = icmp eq i32 %inc, 2048
     40   br i1 %exitcond, label %for.end, label %for.body
     41 
     42 for.end:                                          ; preds = %for.body
     43   ret void
     44 
     45 ; CHECK-LABEL: @foo2
     46 ; CHECK-NOT: mtctr
     47 }
     48 
     49 ; Function Attrs: nounwind
     50 define void @foo3(i128* %a, i128* readonly %b, i128* readonly %c) #0 {
     51 entry:
     52   br label %for.body
     53 
     54 for.body:                                         ; preds = %for.body, %entry
     55   %i.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
     56   %0 = load i128* %b, align 16
     57   %1 = load i128* %c, align 16
     58   %shl = lshr i128 %0, %1
     59   store i128 %shl, i128* %a, align 16
     60   %inc = add nsw i32 %i.02, 1
     61   %exitcond = icmp eq i32 %inc, 2048
     62   br i1 %exitcond, label %for.end, label %for.body
     63 
     64 for.end:                                          ; preds = %for.body
     65   ret void
     66 
     67 ; CHECK-LABEL: @foo3
     68 ; CHECK-NOT: mtctr
     69 }
     70 
     71 attributes #0 = { nounwind }
     72 
     73