1 ; RUN: llc -verify-machineinstrs < %s -mcpu=ppc | FileCheck %s
3 target 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"
4 target triple = "powerpc-unknown-linux-gnu"
6 define i64 @foo(ptr nocapture %n, i64 %d) nounwind readonly {
10 for.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 i64, ptr %n, i32 %i.06
14 %0 = load i64, ptr %arrayidx, align 8
15 %conv = udiv i64 %x.05, %d
16 %conv1 = add i64 %conv, %0
17 %inc = add nsw i32 %i.06, 1
18 %exitcond = icmp eq i32 %inc, 2048
19 br i1 %exitcond, label %for.end, label %for.body
21 for.end: ; preds = %for.body
28 define i64 @foo2(ptr nocapture %n, i64 %d) nounwind readonly {
32 for.body: ; preds = %for.body, %entry
33 %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
34 %x.05 = phi i64 [ 0, %entry ], [ %conv1, %for.body ]
35 %arrayidx = getelementptr inbounds i64, ptr %n, i32 %i.06
36 %0 = load i64, ptr %arrayidx, align 8
37 %conv = sdiv i64 %x.05, %d
38 %conv1 = add i64 %conv, %0
39 %inc = add nsw i32 %i.06, 1
40 %exitcond = icmp eq i32 %inc, 2048
41 br i1 %exitcond, label %for.end, label %for.body
43 for.end: ; preds = %for.body
50 define i64 @foo3(ptr nocapture %n, i64 %d) nounwind readonly {
54 for.body: ; preds = %for.body, %entry
55 %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
56 %x.05 = phi i64 [ 0, %entry ], [ %conv1, %for.body ]
57 %arrayidx = getelementptr inbounds i64, ptr %n, i32 %i.06
58 %0 = load i64, ptr %arrayidx, align 8
59 %conv = urem i64 %x.05, %d
60 %conv1 = add i64 %conv, %0
61 %inc = add nsw i32 %i.06, 1
62 %exitcond = icmp eq i32 %inc, 2048
63 br i1 %exitcond, label %for.end, label %for.body
65 for.end: ; preds = %for.body
72 define i64 @foo4(ptr nocapture %n, i64 %d) nounwind readonly {
76 for.body: ; preds = %for.body, %entry
77 %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
78 %x.05 = phi i64 [ 0, %entry ], [ %conv1, %for.body ]
79 %arrayidx = getelementptr inbounds i64, ptr %n, i32 %i.06
80 %0 = load i64, ptr %arrayidx, align 8
81 %conv = srem i64 %x.05, %d
82 %conv1 = add i64 %conv, %0
83 %inc = add nsw i32 %i.06, 1
84 %exitcond = icmp eq i32 %inc, 2048
85 br i1 %exitcond, label %for.end, label %for.body
87 for.end: ; preds = %for.body