brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 933b2d4 Raw
70 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<opt-isl>' -polly-pattern-matching-based-opts=false -debug -polly-tc-opt -disable-output < %s 2>&1 | FileCheck %s2; RUN: opt %loadNPMPolly '-passes=polly-custom<opt-isl>' -polly-pattern-matching-based-opts=true -debug -polly-tc-opt -disable-output < %s 2>&1 | FileCheck %s --check-prefix=PATTERN-MATCHING-OPTS3; RUN: opt %loadNPMPolly '-passes=polly-custom<opt-isl;ast>' -polly-print-ast -polly-pattern-matching-based-opts=true -polly-ast-detect-parallel -disable-output < %s | FileCheck %s --check-prefix=PARALLEL-AST4; RUN: opt %loadNPMPolly '-passes=polly-custom<opt-isl>' -polly-pattern-matching-based-opts=true -stats -disable-output < %s 2>&1 | FileCheck %s --check-prefix=STATS -match-full-lines5; REQUIRES: asserts6;7;    /* C := alpha*A*B + beta*C */8;    for (i = 0; i < _PB_NI; i++)9;      for (j = 0; j < _PB_NJ; j++)10;        {11;	   C[i][j] *= beta;12;	   for (k = 0; k < _PB_NK; ++k)13;	     C[i][j] += alpha * A[i][k] * B[k][j];14;        }15;16; CHECK-NOT: The matrix multiplication pattern was detected17; CHECK-NOT: The tensor contraction pattern was detected18; PATTERN-MATCHING-OPTS: The tensor contraction pattern was detected19; PATTERN-MATCHING-OPTS: The matrix multiplication pattern was detected20; PARALLEL-AST-NOT: #pragma known-parallel21; STATS:  1 polly-opt-isl    - Number of matrix multiplication patterns detected and optimized22;23target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"24target triple = "x86_64-unknown-unknown"25 26define internal void @kernel_gemm(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %arg4, ptr %arg5, ptr %arg6, ptr %arg7) #0 {27bb:28  br label %bb829 30bb8:                                              ; preds = %bb29, %bb31  %tmp = phi i64 [ 0, %bb ], [ %tmp30, %bb29 ]32  br label %bb933 34bb9:                                              ; preds = %bb26, %bb835  %tmp10 = phi i64 [ 0, %bb8 ], [ %tmp27, %bb26 ]36  %tmp11 = getelementptr inbounds [1056 x double], ptr %arg5, i64 %tmp, i64 %tmp1037  %tmp12 = load double, ptr %tmp11, align 838  %tmp13 = fmul double %tmp12, %arg439  store double %tmp13, ptr %tmp11, align 840  br label %Copy_041 42Copy_0:                                             ; preds = %Copy_0, %bb943  %tmp15 = phi i64 [ 0, %bb9 ], [ %tmp24, %Copy_0 ]44  %tmp16 = getelementptr inbounds [1024 x double], ptr %arg6, i64 %tmp, i64 %tmp1545  %tmp17 = load double, ptr %tmp16, align 846  %tmp18 = fmul double %tmp17, %arg347  %tmp19 = getelementptr inbounds [1056 x double], ptr %arg7, i64 %tmp15, i64 %tmp1048  %tmp20 = load double, ptr %tmp19, align 849  %tmp21 = fmul double %tmp18, %tmp2050  %tmp22 = load double, ptr %tmp11, align 851  %tmp23 = fadd double %tmp22, %tmp2152  store double %tmp23, ptr %tmp11, align 853  %tmp24 = add nuw nsw i64 %tmp15, 154  %tmp25 = icmp ne i64 %tmp24, 102455  br i1 %tmp25, label %Copy_0, label %bb2656 57bb26:                                             ; preds = %Copy_058  %tmp27 = add nuw nsw i64 %tmp10, 159  %tmp28 = icmp ne i64 %tmp27, 105660  br i1 %tmp28, label %bb9, label %bb2961 62bb29:                                             ; preds = %bb2663  %tmp30 = add nuw nsw i64 %tmp, 164  %tmp31 = icmp ne i64 %tmp30, 105665  br i1 %tmp31, label %bb8, label %bb3266 67bb32:                                             ; preds = %bb2968  ret void69}70