blob: c399802a1ee9226b5f1b02541473bbf3e2472c27 [file] [log] [blame]
Hal Finkel638a9fa2013-03-19 18:51:05 +00001; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7
2target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
Hal Finkel559754a42013-03-19 20:22:32 +00005; This test triggers the use of the asymmetric OR8_32 copy pattern.
6
Hal Finkel638a9fa2013-03-19 18:51:05 +00007@gen_random.last = external unnamed_addr global i64, align 8
8@.str = external unnamed_addr constant [4 x i8], align 1
9
10declare double @gen_random(double) #0
11
12declare void @benchmark_heapsort(i32 signext, double* nocapture) #0
13
14define signext i32 @main(i32 signext %argc, i8** nocapture %argv) #0 {
15entry:
16 br i1 undef, label %cond.true, label %cond.end
17
18cond.true: ; preds = %entry
19 br label %cond.end
20
21cond.end: ; preds = %cond.true, %entry
22 %cond = phi i32 [ 0, %cond.true ], [ 8000000, %entry ]
23 %add = add i32 %cond, 1
24 %conv = sext i32 %add to i64
25 %mul = shl nsw i64 %conv, 3
26 %call1 = tail call noalias i8* @malloc(i64 %mul) #1
27 br i1 undef, label %for.end, label %for.body.lr.ph
28
29for.body.lr.ph: ; preds = %cond.end
30 br label %for.body
31
32for.body: ; preds = %for.body, %for.body.lr.ph
33 %indvars.iv = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
34 %indvars.iv.next = add i64 %indvars.iv, 1
35 %lftr.wideiv = trunc i64 %indvars.iv.next to i32
36 %exitcond = icmp eq i32 %lftr.wideiv, %add
37 br i1 %exitcond, label %for.cond.for.end_crit_edge, label %for.body
38
39for.cond.for.end_crit_edge: ; preds = %for.body
40 br label %for.end
41
42for.end: ; preds = %for.cond.for.end_crit_edge, %cond.end
43 ret i32 0
44}
45
46declare noalias i8* @malloc(i64) #0
47
48declare signext i32 @printf(i8* nocapture, ...) #0
49
50declare void @free(i8* nocapture) #0
51
52declare i64 @strtol(i8*, i8** nocapture, i32 signext) #0
53
54attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
55attributes #1 = { nounwind }