summaryrefslogtreecommitdiff
path: root/polly/test/CodeGen/matmul_vec.ll
diff options
context:
space:
mode:
Diffstat (limited to 'polly/test/CodeGen/matmul_vec.ll')
-rw-r--r--polly/test/CodeGen/matmul_vec.ll47
1 files changed, 47 insertions, 0 deletions
diff --git a/polly/test/CodeGen/matmul_vec.ll b/polly/test/CodeGen/matmul_vec.ll
index 14619f2eebf1..82ec9a76488f 100644
--- a/polly/test/CodeGen/matmul_vec.ll
+++ b/polly/test/CodeGen/matmul_vec.ll
@@ -1,5 +1,52 @@
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-codegen %vector-opt -S -dce %s | FileCheck %s
+;#define M 1024
+;#define N 1024
+;#define K 1024
+;float A[K][M];
+;float B[N][K];
+;float C[M][N];
+;/*
+;void matmul_vec(void) {
+; int i, j, k;
+;
+;
+; /* With much unrolling
+; for (i=0;i<=M;i++)
+; for (j=0;j<=N;j+=4)
+; for (k=0;k<=K;k+=8)
+; for (kk=k;kk<=k+7;kk++)
+; for (jj=j;jj<=j+3;jj++)
+; C[i][jj] += A[kk][i] * B[jj][kk];
+; vec_load splat scalar_load
+; */
+; /* Without unrolling
+; for (i=0;i<=M;i++)
+; for (j=0;j<=N;j+=4)
+; for (k=0;k<=K;k++)
+; for (jj=j;jj<=j+3;jj++)
+; C[i][jj] += A[k][i] * B[jj][kk];
+; vec_load splat scalar_load
+; /
+;
+;}
+;i*/
+;int main()
+;{
+; int i, j, k;
+; //matmul_vec();
+; for(i=0; i<M/4; i++)
+; for(k=0; k<K; k++) {
+; for(j=0; j<N; j++)
+; C[i+0][j] += A[k][i+0] * B[j][k];
+; C[i+1][j] += A[k][i+1] * B[j][k];
+; C[i+2][j] += A[k][i+2] * B[j][k];
+; C[i+3][j] += A[k][i+3] * B[j][k];
+; }
+;
+; return A[42][42];
+;}
+
; ModuleID = 'matmul_vec.s'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"