44 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts;delicm;simplify>' -polly-parallel -S < %s | FileCheck %s2;3; Test that parallel codegen handles scalars mapped to other arrays.4; After mapping "store double %add10" references the array "MemRef2".5; Its base pointer therefore needs to be made available in the subfunction.6 7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"8 9define void @reference_latest(ptr nocapture readonly %data, i32 %n, i32 %m) {10entry:11 %0 = alloca double, i64 undef, align 1612 %conv1 = sext i32 %m to i6413 br label %while.body14 15while.body:16 %indvars.iv211 = phi i64 [ %conv1, %entry ], [ %indvars.iv.next212, %for.end ]17 br label %for.body18 19for.body:20 %indvars.iv207 = phi i64 [ %indvars.iv211, %while.body ], [ %indvars.iv.next208, %for.body ]21 %1 = load float, ptr %data, align 422 %add10 = fadd double undef, undef23 %indvars.iv.next208 = add nsw i64 %indvars.iv207, 124 %lftr.wideiv = trunc i64 %indvars.iv.next208 to i3225 %exitcond210 = icmp eq i32 %lftr.wideiv, %n26 br i1 %exitcond210, label %for.end, label %for.body27 28for.end:29 %arrayidx12 = getelementptr inbounds double, ptr %0, i64 %indvars.iv21130 store double %add10, ptr %arrayidx12, align 831 %indvars.iv.next212 = add nsw i64 %indvars.iv211, -132 %2 = trunc i64 %indvars.iv211 to i3233 %tobool = icmp eq i32 %2, 034 br i1 %tobool, label %while.end, label %while.body35 36while.end:37 ret void38}39 40; CHECK-LABEL: define internal void @reference_latest_polly_subfn(ptr %polly.par.userContext)41 42; CHECK: %polly.access.polly.subfunc.arg. = getelementptr double, ptr %polly.subfunc.arg., i64 %{{[0-9]+}}43; CHECK-NEXT: store double %p_add{{[0-9]*}}, ptr %polly.access.polly.subfunc.arg.44