brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.6 KiB · 06e08c4 Raw
98 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<mse>' -polly-print-mse -disable-output < %s | FileCheck %s2;3; Verify that the accesses are correctly expanded for MemoryKind::Array4;5; Original source code :6;7; #define Ni 20008; #define Nj 30009;10; void tmp3(double A[Ni], double B[Nj]) {11;   int i,j;12;   double tmp = 6;13;   for (i = 0; i < Ni; i++) {14;15;     for(int h = 0; h<Nj; h++)16;      B[h] = h;17;18;     for(j = 0; j < Nj; j++) {19;      for(int k=0; k<Nj; k++) {20; 	tmp = i+k+j;21; 	A[i+j] = tmp*B[k];22;       }23;     }24;   }25; }26;27; Check if the expanded SAI are created28;29; CHECK: double MemRef_B_Stmt_for_body3_expanded[10000][10000]; // Element size 830; CHECK: double MemRef_A_Stmt_for_body11_expanded[10000][10000][10000]; // Element size 831;32; Check if the memory accesses are modified33;34; CHECK: new: { Stmt_for_body3[i0, i1] -> MemRef_B_Stmt_for_body3_expanded[i0, i1] };35; CHECK: new: { Stmt_for_body11[i0, i1, i2] -> MemRef_B_Stmt_for_body3_expanded[i0, i2] };36; CHECK: new: { Stmt_for_body11[i0, i1, i2] -> MemRef_A_Stmt_for_body11_expanded[i0, i1, i2] };37;38target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"39target triple = "x86_64-unknown-linux-gnu"40 41define void @mse(ptr %A, ptr %B) {42entry:43  br label %entry.split44 45entry.split:                                      ; preds = %entry46  br label %for.body47 48for.body:                                         ; preds = %entry.split, %for.inc2549  %indvars.iv14 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next15, %for.inc25 ]50  br label %for.body351 52for.body3:                                        ; preds = %for.body, %for.body353  %indvars.iv = phi i64 [ 0, %for.body ], [ %indvars.iv.next, %for.body3 ]54  %0 = trunc i64 %indvars.iv to i3255  %conv = sitofp i32 %0 to double56  %arrayidx = getelementptr inbounds double, ptr %B, i64 %indvars.iv57  store double %conv, ptr %arrayidx, align 858  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 159  %exitcond = icmp ne i64 %indvars.iv.next, 1000060  br i1 %exitcond, label %for.body3, label %for.end61 62for.end:                                          ; preds = %for.body363  br label %for.body764 65for.body7:                                        ; preds = %for.end, %for.inc2266  %indvars.iv9 = phi i64 [ 0, %for.end ], [ %indvars.iv.next10, %for.inc22 ]67  br label %for.body1168 69for.body11:                                       ; preds = %for.body7, %for.body1170  %indvars.iv5 = phi i64 [ 0, %for.body7 ], [ %indvars.iv.next6, %for.body11 ]71  %1 = add nuw nsw i64 %indvars.iv9, %indvars.iv1472  %2 = add nuw nsw i64 %1, %indvars.iv573  %3 = trunc i64 %2 to i3274  %conv13 = sitofp i32 %3 to double75  %arrayidx15 = getelementptr inbounds double, ptr %B, i64 %indvars.iv576  %4 = load double, ptr %arrayidx15, align 877  %mul = fmul double %4, %conv1378  %5 = add nuw nsw i64 %indvars.iv9, %indvars.iv1479  %arrayidx18 = getelementptr inbounds double, ptr %A, i64 %580  store double %mul, ptr %arrayidx18, align 881  %indvars.iv.next6 = add nuw nsw i64 %indvars.iv5, 182  %exitcond8 = icmp ne i64 %indvars.iv.next6, 1000083  br i1 %exitcond8, label %for.body11, label %for.inc2284 85for.inc22:                                        ; preds = %for.body1186  %indvars.iv.next10 = add nuw nsw i64 %indvars.iv9, 187  %exitcond13 = icmp ne i64 %indvars.iv.next10, 1000088  br i1 %exitcond13, label %for.body7, label %for.inc2589 90for.inc25:                                        ; preds = %for.inc2291  %indvars.iv.next15 = add nuw nsw i64 %indvars.iv14, 192  %exitcond16 = icmp ne i64 %indvars.iv.next15, 1000093  br i1 %exitcond16, label %for.body, label %for.end2794 95for.end27:                                        ; preds = %for.inc2596  ret void97}98