103 lines · plain
1; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa '-passes=polly-custom<detect>' -polly-print-detect -disable-output < %s 2>&1 | FileCheck %s2;3; CHECK: Valid Region for Scop: for.cond => for.end4;5; #include "math.h"6;7; void jd(int *restrict A, float *restrict B) {8; for (int i = 0; i < 1024; i++) {9; A[i] = pow(ceil(log10(sqrt(i))), floor(log2(i)));10; B[i] = fabs(log(sin(i)) + exp2(cos(i))) + exp(i);11; }12; }13;14; ModuleID = '/home/johannes/repos/polly/test/ScopDetect/intrinsics.ll'15target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"16 17; Function Attrs: nounwind uwtable18define void @jd(ptr noalias %A, ptr noalias %B) {19entry:20 br label %for.cond21 22for.cond: ; preds = %for.inc, %entry23 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]24 %exitcond = icmp ne i64 %indvars.iv, 102425 br i1 %exitcond, label %for.body, label %for.end26 27for.body: ; preds = %for.cond28 %tmp = trunc i64 %indvars.iv to i3229 %conv = sitofp i32 %tmp to double30 %tmp1 = call double @llvm.sqrt.f64(double %conv)31 %call = call double @__log10_finite(double %tmp1)32 %call1 = call double @ceil(double %call)33 %tmp2 = trunc i64 %indvars.iv to i3234 %conv2 = sitofp i32 %tmp2 to double35 %call3 = call double @__log2_finite(double %conv2)36 %call4 = call double @floor(double %call3)37 %tmp3 = call double @llvm.pow.f64(double %call1, double %call4)38 %conv5 = fptosi double %tmp3 to i3239 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv40 store i32 %conv5, ptr %arrayidx, align 441 %tmp4 = trunc i64 %indvars.iv to i3242 %conv6 = sitofp i32 %tmp4 to double43 %call7 = call double @sin(double %conv6)44 %call8 = call double @__log_finite(double %call7)45 %tmp5 = trunc i64 %indvars.iv to i3246 %conv9 = sitofp i32 %tmp5 to double47 %call10 = call double @cos(double %conv9)48 %call11 = call double @__exp2_finite(double %call10)49 %add = fadd fast double %call8, %call1150 %call12 = call double @fabs(double %add)51 %tmp6 = trunc i64 %indvars.iv to i3252 %conv13 = sitofp i32 %tmp6 to double53 %call14 = call double @__exp_finite(double %conv13)54 %add15 = fadd fast double %call12, %call1455 %conv16 = fptrunc double %add15 to float56 %arrayidx18 = getelementptr inbounds float, ptr %B, i64 %indvars.iv57 store float %conv16, ptr %arrayidx18, align 458 br label %for.inc59 60for.inc: ; preds = %for.body61 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 162 br label %for.cond63 64for.end: ; preds = %for.cond65 ret void66}67 68; Function Attrs: nounwind readnone69declare double @ceil(double)70 71; Function Attrs: nounwind readnone72declare double @__log10_finite(double)73 74; Function Attrs: nounwind readnone75declare double @llvm.sqrt.f64(double)76 77; Function Attrs: nounwind readnone78declare double @floor(double)79 80; Function Attrs: nounwind readnone81declare double @__log2_finite(double)82 83; Function Attrs: nounwind readnone84declare double @llvm.pow.f64(double, double)85 86; Function Attrs: nounwind readnone87declare double @fabs(double)88 89; Function Attrs: nounwind readnone90declare double @__log_finite(double)91 92; Function Attrs: nounwind readnone93declare double @sin(double)94 95; Function Attrs: nounwind readnone96declare double @__exp2_finite(double)97 98; Function Attrs: nounwind readnone99declare double @cos(double)100 101; Function Attrs: nounwind readnone102declare double @__exp_finite(double)103