1 ; RUN: opt %loadPolly -polly-opt-isl -polly-pattern-matching-based-opts=true \
2 ; RUN: -polly-tc-opt=true -debug -disable-output < %s 2>&1 | FileCheck %s
5 ; for (int i = 0; i < 32; i++)
6 ; for (int j = 0; j < 32; j++)
7 ; for (int l = 0; l < 32; l++)
8 ; for (int w = 0; w < 32; w++)
9 ; C[i][j] += A[i][l][w] * B[w][j][i];
11 ; CHECK-NOT: The tensor contraction pattern was detected
13 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
14 target triple = "x86_64-unknown-linux-gnu"
16 define void @foo(ptr noundef %C, ptr noundef %A, ptr noundef %B) {
18 br label %for.cond1.preheader
20 for.cond1.preheader: ; preds = %for.inc33, %entry
21 %indvars.iv49 = phi i64 [ 0, %entry ], [ %indvars.iv.next50, %for.inc33 ]
22 br label %for.cond5.preheader
24 for.cond5.preheader: ; preds = %for.inc30, %for.cond1.preheader
25 %indvars.iv45 = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next46, %for.inc30 ]
26 br label %for.cond9.preheader
28 for.cond9.preheader: ; preds = %for.inc27, %for.cond5.preheader
29 %indvars.iv41 = phi i64 [ 0, %for.cond5.preheader ], [ %indvars.iv.next42, %for.inc27 ]
32 for.body12: ; preds = %for.body12, %for.cond9.preheader
33 %indvars.iv = phi i64 [ 0, %for.cond9.preheader ], [ %indvars.iv.next, %for.body12 ]
34 %arrayidx16 = getelementptr inbounds [64 x [64 x double]], ptr %A, i64 %indvars.iv49, i64 %indvars.iv41, i64 %indvars.iv
35 %i = load double, ptr %arrayidx16, align 8
36 %arrayidx22 = getelementptr inbounds [64 x [64 x double]], ptr %B, i64 %indvars.iv, i64 %indvars.iv45, i64 %indvars.iv49
37 %i1 = load double, ptr %arrayidx22, align 8
38 %mul = fmul fast double %i1, %i
39 %arrayidx26 = getelementptr inbounds [64 x double], ptr %C, i64 %indvars.iv49, i64 %indvars.iv45
40 %i2 = load double, ptr %arrayidx26, align 8
41 %add = fadd fast double %i2, %mul
42 store double %add, ptr %arrayidx26, align 8
43 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
44 %exitcond = icmp ne i64 %indvars.iv.next, 32
45 br i1 %exitcond, label %for.body12, label %for.inc27
47 for.inc27: ; preds = %for.body12
48 %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
49 %exitcond44 = icmp ne i64 %indvars.iv.next42, 32
50 br i1 %exitcond44, label %for.cond9.preheader, label %for.inc30
52 for.inc30: ; preds = %for.inc27
53 %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
54 %exitcond48 = icmp ne i64 %indvars.iv.next46, 32
55 br i1 %exitcond48, label %for.cond5.preheader, label %for.inc33
57 for.inc33: ; preds = %for.inc30
58 %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
59 %exitcond52 = icmp ne i64 %indvars.iv.next50, 32
60 br i1 %exitcond52, label %for.cond1.preheader, label %for.end35
62 for.end35: ; preds = %for.inc33