blob: 78974248da5a547597e5ab45a46b9937671c9db5 [file] [log] [blame]
Hal Finkel2a5e8c32013-05-16 16:52:41 +00001; RUN: llc < %s -mcpu=generic | FileCheck %s
2
3target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32"
4target triple = "powerpc-unknown-linux-gnu"
5
6define i64 @foo(double* nocapture %n) nounwind readonly {
7entry:
8 br label %for.body
9
10for.body: ; preds = %for.body, %entry
11 %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
12 %x.05 = phi i64 [ 0, %entry ], [ %conv1, %for.body ]
13 %arrayidx = getelementptr inbounds double* %n, i32 %i.06
14 %0 = load double* %arrayidx, align 8
15 %conv = sitofp i64 %x.05 to double
16 %add = fadd double %conv, %0
17 %conv1 = fptosi double %add to i64
18 %inc = add nsw i32 %i.06, 1
19 %exitcond = icmp eq i32 %inc, 2048
20 br i1 %exitcond, label %for.end, label %for.body
21
22for.end: ; preds = %for.body
23 ret i64 %conv1
24}
25
26; CHECK: @foo
27; CHECK-NOT: mtctr
28