brintos

brintos / llvm-project-archived public Read only

0
0
Text · 11.7 KiB · 0100c42 Raw
221 lines · plain
1; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu -mcpu=g4 | FileCheck %s2; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=g4 | FileCheck %s3 4; ModuleID = 'tsc.c'5target 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-v128:128:128-n32:64"6target triple = "powerpc64-unknown-linux-gnu"7 8@a = common global [32000 x float] zeroinitializer, align 169@b = common global [32000 x float] zeroinitializer, align 1610@c = common global [32000 x float] zeroinitializer, align 1611@d = common global [32000 x float] zeroinitializer, align 1612@e = common global [32000 x float] zeroinitializer, align 1613@aa = common global [256 x [256 x float]] zeroinitializer, align 1614@bb = common global [256 x [256 x float]] zeroinitializer, align 1615@cc = common global [256 x [256 x float]] zeroinitializer, align 1616@temp = common global float 0.000000e+00, align 417 18@.str81 = private unnamed_addr constant [6 x i8] c"s3110\00", align 119@.str235 = private unnamed_addr constant [15 x i8] c"S3110\09 %.2f \09\09\00", align 120 21declare i32 @printf(ptr nocapture, ...) nounwind22declare i32 @init(ptr %name) nounwind23declare i64 @clock() nounwind24declare i32 @dummy(ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, float)25declare void @check(i32 %name) nounwind26 27; CHECK: mfcr28; CHECK: mtcr29 30define i32 @s3110() nounwind {31entry:32  %call = tail call i32 @init(ptr @.str81)33  %call1 = tail call i64 @clock() nounwind34  br label %for.body35 36for.body:                                         ; preds = %for.end17, %entry37  %nl.041 = phi i32 [ 0, %entry ], [ %inc22, %for.end17 ]38  %0 = load float, ptr @aa, align 1639  br label %for.cond5.preheader40 41for.cond5.preheader:                              ; preds = %for.inc15, %for.body42  %indvars.iv42 = phi i64 [ 0, %for.body ], [ %indvars.iv.next43, %for.inc15 ]43  %max.139 = phi float [ %0, %for.body ], [ %max.3.15, %for.inc15 ]44  %xindex.138 = phi i32 [ 0, %for.body ], [ %xindex.3.15, %for.inc15 ]45  %yindex.137 = phi i32 [ 0, %for.body ], [ %yindex.3.15, %for.inc15 ]46  br label %for.body747 48for.body7:                                        ; preds = %for.body7, %for.cond5.preheader49  %indvars.iv = phi i64 [ 0, %for.cond5.preheader ], [ %indvars.iv.next.15, %for.body7 ]50  %max.235 = phi float [ %max.139, %for.cond5.preheader ], [ %max.3.15, %for.body7 ]51  %xindex.234 = phi i32 [ %xindex.138, %for.cond5.preheader ], [ %xindex.3.15, %for.body7 ]52  %yindex.233 = phi i32 [ %yindex.137, %for.cond5.preheader ], [ %yindex.3.15, %for.body7 ]53  %arrayidx9 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv54  %1 = load float, ptr %arrayidx9, align 1655  %cmp10 = fcmp ogt float %1, %max.23556  %2 = trunc i64 %indvars.iv to i3257  %yindex.3 = select i1 %cmp10, i32 %2, i32 %yindex.23358  %3 = trunc i64 %indvars.iv42 to i3259  %xindex.3 = select i1 %cmp10, i32 %3, i32 %xindex.23460  %max.3 = select i1 %cmp10, float %1, float %max.23561  %indvars.iv.next45 = or i64 %indvars.iv, 162  %arrayidx9.1 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next4563  %4 = load float, ptr %arrayidx9.1, align 464  %cmp10.1 = fcmp ogt float %4, %max.365  %5 = trunc i64 %indvars.iv.next45 to i3266  %yindex.3.1 = select i1 %cmp10.1, i32 %5, i32 %yindex.367  %xindex.3.1 = select i1 %cmp10.1, i32 %3, i32 %xindex.368  %max.3.1 = select i1 %cmp10.1, float %4, float %max.369  %indvars.iv.next.146 = or i64 %indvars.iv, 270  %arrayidx9.2 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.14671  %6 = load float, ptr %arrayidx9.2, align 872  %cmp10.2 = fcmp ogt float %6, %max.3.173  %7 = trunc i64 %indvars.iv.next.146 to i3274  %yindex.3.2 = select i1 %cmp10.2, i32 %7, i32 %yindex.3.175  %xindex.3.2 = select i1 %cmp10.2, i32 %3, i32 %xindex.3.176  %max.3.2 = select i1 %cmp10.2, float %6, float %max.3.177  %indvars.iv.next.247 = or i64 %indvars.iv, 378  %arrayidx9.3 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.24779  %8 = load float, ptr %arrayidx9.3, align 480  %cmp10.3 = fcmp ogt float %8, %max.3.281  %9 = trunc i64 %indvars.iv.next.247 to i3282  %yindex.3.3 = select i1 %cmp10.3, i32 %9, i32 %yindex.3.283  %xindex.3.3 = select i1 %cmp10.3, i32 %3, i32 %xindex.3.284  %max.3.3 = select i1 %cmp10.3, float %8, float %max.3.285  %indvars.iv.next.348 = or i64 %indvars.iv, 486  %arrayidx9.4 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.34887  %10 = load float, ptr %arrayidx9.4, align 1688  %cmp10.4 = fcmp ogt float %10, %max.3.389  %11 = trunc i64 %indvars.iv.next.348 to i3290  %yindex.3.4 = select i1 %cmp10.4, i32 %11, i32 %yindex.3.391  %xindex.3.4 = select i1 %cmp10.4, i32 %3, i32 %xindex.3.392  %max.3.4 = select i1 %cmp10.4, float %10, float %max.3.393  %indvars.iv.next.449 = or i64 %indvars.iv, 594  %arrayidx9.5 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.44995  %12 = load float, ptr %arrayidx9.5, align 496  %cmp10.5 = fcmp ogt float %12, %max.3.497  %13 = trunc i64 %indvars.iv.next.449 to i3298  %yindex.3.5 = select i1 %cmp10.5, i32 %13, i32 %yindex.3.499  %xindex.3.5 = select i1 %cmp10.5, i32 %3, i32 %xindex.3.4100  %max.3.5 = select i1 %cmp10.5, float %12, float %max.3.4101  %indvars.iv.next.550 = or i64 %indvars.iv, 6102  %arrayidx9.6 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.550103  %14 = load float, ptr %arrayidx9.6, align 8104  %cmp10.6 = fcmp ogt float %14, %max.3.5105  %15 = trunc i64 %indvars.iv.next.550 to i32106  %yindex.3.6 = select i1 %cmp10.6, i32 %15, i32 %yindex.3.5107  %xindex.3.6 = select i1 %cmp10.6, i32 %3, i32 %xindex.3.5108  %max.3.6 = select i1 %cmp10.6, float %14, float %max.3.5109  %indvars.iv.next.651 = or i64 %indvars.iv, 7110  %arrayidx9.7 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.651111  %16 = load float, ptr %arrayidx9.7, align 4112  %cmp10.7 = fcmp ogt float %16, %max.3.6113  %17 = trunc i64 %indvars.iv.next.651 to i32114  %yindex.3.7 = select i1 %cmp10.7, i32 %17, i32 %yindex.3.6115  %xindex.3.7 = select i1 %cmp10.7, i32 %3, i32 %xindex.3.6116  %max.3.7 = select i1 %cmp10.7, float %16, float %max.3.6117  %indvars.iv.next.752 = or i64 %indvars.iv, 8118  %arrayidx9.8 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.752119  %18 = load float, ptr %arrayidx9.8, align 16120  %cmp10.8 = fcmp ogt float %18, %max.3.7121  %19 = trunc i64 %indvars.iv.next.752 to i32122  %yindex.3.8 = select i1 %cmp10.8, i32 %19, i32 %yindex.3.7123  %xindex.3.8 = select i1 %cmp10.8, i32 %3, i32 %xindex.3.7124  %max.3.8 = select i1 %cmp10.8, float %18, float %max.3.7125  %indvars.iv.next.853 = or i64 %indvars.iv, 9126  %arrayidx9.9 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.853127  %20 = load float, ptr %arrayidx9.9, align 4128  %cmp10.9 = fcmp ogt float %20, %max.3.8129  %21 = trunc i64 %indvars.iv.next.853 to i32130  %yindex.3.9 = select i1 %cmp10.9, i32 %21, i32 %yindex.3.8131  %xindex.3.9 = select i1 %cmp10.9, i32 %3, i32 %xindex.3.8132  %max.3.9 = select i1 %cmp10.9, float %20, float %max.3.8133  %indvars.iv.next.954 = or i64 %indvars.iv, 10134  %arrayidx9.10 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.954135  %22 = load float, ptr %arrayidx9.10, align 8136  %cmp10.10 = fcmp ogt float %22, %max.3.9137  %23 = trunc i64 %indvars.iv.next.954 to i32138  %yindex.3.10 = select i1 %cmp10.10, i32 %23, i32 %yindex.3.9139  %xindex.3.10 = select i1 %cmp10.10, i32 %3, i32 %xindex.3.9140  %max.3.10 = select i1 %cmp10.10, float %22, float %max.3.9141  %indvars.iv.next.1055 = or i64 %indvars.iv, 11142  %arrayidx9.11 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.1055143  %24 = load float, ptr %arrayidx9.11, align 4144  %cmp10.11 = fcmp ogt float %24, %max.3.10145  %25 = trunc i64 %indvars.iv.next.1055 to i32146  %yindex.3.11 = select i1 %cmp10.11, i32 %25, i32 %yindex.3.10147  %xindex.3.11 = select i1 %cmp10.11, i32 %3, i32 %xindex.3.10148  %max.3.11 = select i1 %cmp10.11, float %24, float %max.3.10149  %indvars.iv.next.1156 = or i64 %indvars.iv, 12150  %arrayidx9.12 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.1156151  %26 = load float, ptr %arrayidx9.12, align 16152  %cmp10.12 = fcmp ogt float %26, %max.3.11153  %27 = trunc i64 %indvars.iv.next.1156 to i32154  %yindex.3.12 = select i1 %cmp10.12, i32 %27, i32 %yindex.3.11155  %xindex.3.12 = select i1 %cmp10.12, i32 %3, i32 %xindex.3.11156  %max.3.12 = select i1 %cmp10.12, float %26, float %max.3.11157  %indvars.iv.next.1257 = or i64 %indvars.iv, 13158  %arrayidx9.13 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.1257159  %28 = load float, ptr %arrayidx9.13, align 4160  %cmp10.13 = fcmp ogt float %28, %max.3.12161  %29 = trunc i64 %indvars.iv.next.1257 to i32162  %yindex.3.13 = select i1 %cmp10.13, i32 %29, i32 %yindex.3.12163  %xindex.3.13 = select i1 %cmp10.13, i32 %3, i32 %xindex.3.12164  %max.3.13 = select i1 %cmp10.13, float %28, float %max.3.12165  %indvars.iv.next.1358 = or i64 %indvars.iv, 14166  %arrayidx9.14 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.1358167  %30 = load float, ptr %arrayidx9.14, align 8168  %cmp10.14 = fcmp ogt float %30, %max.3.13169  %31 = trunc i64 %indvars.iv.next.1358 to i32170  %yindex.3.14 = select i1 %cmp10.14, i32 %31, i32 %yindex.3.13171  %xindex.3.14 = select i1 %cmp10.14, i32 %3, i32 %xindex.3.13172  %max.3.14 = select i1 %cmp10.14, float %30, float %max.3.13173  %indvars.iv.next.1459 = or i64 %indvars.iv, 15174  %arrayidx9.15 = getelementptr inbounds [256 x [256 x float]], ptr @aa, i64 0, i64 %indvars.iv42, i64 %indvars.iv.next.1459175  %32 = load float, ptr %arrayidx9.15, align 4176  %cmp10.15 = fcmp ogt float %32, %max.3.14177  %33 = trunc i64 %indvars.iv.next.1459 to i32178  %yindex.3.15 = select i1 %cmp10.15, i32 %33, i32 %yindex.3.14179  %xindex.3.15 = select i1 %cmp10.15, i32 %3, i32 %xindex.3.14180  %max.3.15 = select i1 %cmp10.15, float %32, float %max.3.14181  %indvars.iv.next.15 = add i64 %indvars.iv, 16182  %lftr.wideiv.15 = trunc i64 %indvars.iv.next.15 to i32183  %exitcond.15 = icmp eq i32 %lftr.wideiv.15, 256184  br i1 %exitcond.15, label %for.inc15, label %for.body7185 186for.inc15:                                        ; preds = %for.body7187  %indvars.iv.next43 = add i64 %indvars.iv42, 1188  %lftr.wideiv = trunc i64 %indvars.iv.next43 to i32189  %exitcond = icmp eq i32 %lftr.wideiv, 256190  br i1 %exitcond, label %for.end17, label %for.cond5.preheader191 192for.end17:                                        ; preds = %for.inc15193  %conv = sitofp i32 %xindex.3.15 to float194  %add = fadd float %max.3.15, %conv195  %conv18 = sitofp i32 %yindex.3.15 to float196  %add19 = fadd float %add, %conv18197  %call20 = tail call i32 @dummy(ptr @a, ptr @b, ptr @c, ptr @d, ptr @e, ptr @aa, ptr @bb, ptr @cc, float %add19) nounwind198  %inc22 = add nsw i32 %nl.041, 1199  %exitcond44 = icmp eq i32 %inc22, 78100200  br i1 %exitcond44, label %for.end23, label %for.body201 202for.end23:                                        ; preds = %for.end17203  %call24 = tail call i64 @clock() nounwind204  %sub = sub nsw i64 %call24, %call1205  %conv25 = sitofp i64 %sub to double206  %div = fdiv double %conv25, 1.000000e+06207  %call26 = tail call i32 (ptr, ...) @printf(ptr @.str235, double %div) nounwind208  %add29 = fadd float %add, 1.000000e+00209  %add31 = fadd float %add29, %conv18210  %add32 = fadd float %add31, 1.000000e+00211  store float %add32, ptr @temp, align 4212  tail call void @check(i32 -1)213  ret i32 0214}215 216declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1) nounwind217 218declare i32 @puts(ptr nocapture) nounwind219 220!3 = !{!"branch_weights", i32 64, i32 4}221