Hal Finkel | ffb460f | 2015-04-11 00:33:08 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
| 2 | target datalayout = "E-m:e-i64:64-n32:64" |
| 3 | target triple = "powerpc64-unknown-linux-gnu" |
| 4 | |
| 5 | ; Function Attrs: nounwind |
| 6 | define void @foo(double* %x, double* nocapture readonly %y) #0 { |
| 7 | entry: |
| 8 | br label %for.cond1.preheader |
| 9 | |
| 10 | for.cond1.preheader: ; preds = %for.end, %entry |
| 11 | %i.015 = phi i32 [ 0, %entry ], [ %inc7, %for.end ] |
| 12 | br label %for.body3 |
| 13 | |
| 14 | for.body3: ; preds = %for.body3, %for.cond1.preheader |
| 15 | %indvars.iv = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next, %for.body3 ] |
| 16 | %arrayidx = getelementptr inbounds double, double* %y, i64 %indvars.iv |
| 17 | %0 = load double, double* %arrayidx, align 8 |
| 18 | %add = fadd double %0, 1.000000e+00 |
| 19 | %arrayidx5 = getelementptr inbounds double, double* %x, i64 %indvars.iv |
| 20 | store double %add, double* %arrayidx5, align 8 |
| 21 | %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 |
| 22 | %exitcond = icmp eq i64 %indvars.iv.next, 16000 |
| 23 | br i1 %exitcond, label %for.end, label %for.body3 |
| 24 | |
| 25 | for.end: ; preds = %for.body3 |
| 26 | tail call void @bar(double* %x) #2 |
| 27 | %inc7 = add nuw nsw i32 %i.015, 1 |
| 28 | %exitcond16 = icmp eq i32 %inc7, 1000 |
| 29 | br i1 %exitcond16, label %for.end8, label %for.cond1.preheader |
| 30 | |
| 31 | for.end8: ; preds = %for.end |
| 32 | ret void |
| 33 | |
| 34 | ; CHECK-LABEL: @foo |
| 35 | |
| 36 | ; CHECK: lfdu [[REG1:[0-9]+]], 8({{[0-9]+}}) |
| 37 | ; CHECK: fadd [[REG2:[0-9]+]], [[REG1]], {{[0-9]+}} |
| 38 | ; CHECK: stfdu [[REG2]], 8({{[0-9]+}}) |
| 39 | ; CHECK: bdnz |
| 40 | |
| 41 | ; CHECK: bl bar |
| 42 | ; CHECK-NEXT: nop |
| 43 | |
| 44 | ; CHECK: blr |
| 45 | } |
| 46 | |
| 47 | declare void @bar(double*) #1 |
| 48 | |
| 49 | attributes #0 = { nounwind "target-cpu"="a2" } |
| 50 | attributes #1 = { "target-cpu"="a2" } |
| 51 | attributes #2 = { nounwind } |
| 52 | |