brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 457213a Raw
59 lines · plain
1; RUN: llc -verify-machineinstrs < %s -mcpu=ppc | FileCheck %s2 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(ptr nocapture %n) nounwind readonly {7entry:8  br label %for.body9 10for.body:                                         ; preds = %for.body, %entry11  %i.06 = phi i32 [ 0, %entry ], [ %inc, %for.body ]12  %x.05 = phi i64 [ 0, %entry ], [ %conv1, %for.body ]13  %arrayidx = getelementptr inbounds double, ptr %n, i32 %i.0614  %0 = load double, ptr %arrayidx, align 815  %conv = sitofp i64 %x.05 to double16  %add = fadd double %conv, %017  %conv1 = fptosi double %add to i6418  %inc = add nsw i32 %i.06, 119  %exitcond = icmp eq i32 %inc, 204820  br i1 %exitcond, label %for.end, label %for.body21 22for.end:                                          ; preds = %for.body23  ret i64 %conv124}25 26; CHECK: @foo27; CHECK-NOT: mtctr28 29@init_value = global double 1.000000e+00, align 830@data64 = global [8000 x i64] zeroinitializer, align 831 32define i32 @main(i32 %argc, ptr nocapture %argv) {33entry:34  %0 = load double, ptr @init_value, align 835  %conv = fptosi double %0 to i6436  %broadcast.splatinsert.i = insertelement <2 x i64> undef, i64 %conv, i32 037  %broadcast.splat.i = shufflevector <2 x i64> %broadcast.splatinsert.i, <2 x i64> undef, <2 x i32> zeroinitializer38  br label %vector.body.i39 40vector.body.i:                                    ; preds = %vector.body.i, %entry41  %index.i = phi i32 [ 0, %entry ], [ %index.next.i, %vector.body.i ]42  %next.gep.i = getelementptr [8000 x i64], ptr @data64, i32 0, i32 %index.i43  store <2 x i64> %broadcast.splat.i, ptr %next.gep.i, align 844  %next.gep.sum24.i = or i32 %index.i, 245  %1 = getelementptr [8000 x i64], ptr @data64, i32 0, i32 %next.gep.sum24.i46  store <2 x i64> %broadcast.splat.i, ptr %1, align 847  %index.next.i = add i32 %index.i, 448  %2 = icmp eq i32 %index.next.i, 800049  br i1 %2, label %_Z4fillIPxxEvT_S1_T0_.exit, label %vector.body.i50 51_Z4fillIPxxEvT_S1_T0_.exit:                       ; preds = %vector.body.i52  ret i32 053}54 55; CHECK: @main56; CHECK: __fixdfdi57; CHECK: mtctr58 59