brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 98c1db6 Raw
60 lines · plain
1; RUN: opt %loadNPMPolly -polly-import-jscop-postfix=transformed '-passes=polly-custom<import-jscop;opt-isl>' -debug-only=polly-opt-isl -disable-output < %s 2>&1 | FileCheck %s2; REQUIRES: asserts3;4; void pattern_matching_based_opts_splitmap(double C[static const restrict 2][2], double A[static const restrict 2][784], double B[static const restrict 784][2]) {5;  for (int i = 0; i < 2; i+=1)6;    for (int j = 0; j < 2; j+=1)7;      for (int k = 0; k < 784; k+=1)8;        C[i][j] += A[i][k] * B[k][j];9;}10;11; Check that the pattern matching detects the matrix multiplication pattern12; when the AccMap cannot be reduced to a single disjunct.13;14; CHECK: The matrix multiplication pattern was detected15;16; ModuleID = 'pattern_matching_based_opts_splitmap.ll'17;18; Function Attrs: noinline nounwind uwtable19define void @pattern_matching_based_opts_splitmap(ptr noalias dereferenceable(32) %C, ptr noalias dereferenceable(12544) %A, ptr noalias dereferenceable(12544) %B) {20entry:21  br label %for.body22 23for.body:                                         ; preds = %entry, %for.inc2124  %i = phi i64 [ 0, %entry ], [ %add22, %for.inc21 ]25  br label %for.body326 27for.body3:                                        ; preds = %for.body, %for.inc1828  %j = phi i64 [ 0, %for.body ], [ %add19, %for.inc18 ]29  br label %for.body630 31for.body6:                                        ; preds = %for.body3, %for.body632  %k = phi i64 [ 0, %for.body3 ], [ %add17, %for.body6 ]33  %arrayidx8 = getelementptr inbounds [784 x double], ptr %A, i64 %i, i64 %k34  %tmp6 = load double, ptr %arrayidx8, align 835  %arrayidx12 = getelementptr inbounds [2 x double], ptr %B, i64 %k, i64 %j36  %tmp10 = load double, ptr %arrayidx12, align 837  %mul = fmul double %tmp6, %tmp1038  %arrayidx16 = getelementptr inbounds [2 x double], ptr %C, i64 %i, i64 %j39  %tmp14 = load double, ptr %arrayidx16, align 840  %add = fadd double %tmp14, %mul41  store double %add, ptr %arrayidx16, align 842  %add17 = add nsw i64 %k, 143  %cmp5 = icmp slt i64 %add17, 78444  br i1 %cmp5, label %for.body6, label %for.inc1845 46for.inc18:                                        ; preds = %for.body647  %add19 = add nsw i64 %j, 148  %cmp2 = icmp slt i64 %add19, 249  br i1 %cmp2, label %for.body3, label %for.inc2150 51for.inc21:                                        ; preds = %for.inc1852  %add22 = add nsw i64 %i, 153  %cmp = icmp slt i64 %add22, 254  br i1 %cmp, label %for.body, label %for.end2355 56for.end23:                                        ; preds = %for.inc2157  ret void58}59 60