Fix Polly
[polly-mirror.git] / test / ScheduleOptimizer / pattern-matching-based-opts-after-delicm.ll
blob7beafbcca7b7d39b300134740137ed07f508cfbf
1 ; RUN: opt %loadPolly \
2 ; RUN: -polly-pattern-matching-based-opts=true \
3 ; RUN: -polly-optree -polly-delicm -polly-simplify \
4 ; RUN: -polly-opt-isl -debug < %s 2>&1 \
5 ; RUN: | FileCheck %s
6 ; REQUIRES: asserts
8 ; Check that the pattern matching detects the matrix multiplication pattern
9 ; after a full run of -polly-optree and -polly-delicm, where the write access
10 ; is not through the original memory access, but trough a PHI node that was
11 ; delicmed. This test covers the polybench 2mm and 3mm cases.
13 ; CHECK: The matrix multiplication pattern was detected
16 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
17 target triple = "x86_64-unknown-linux-gnu"
19 ; Function Attrs: norecurse nounwind uwtable
20 define void @kernel_2mm(i32 %ni, i32 %nj, i32 %nk, i32 %nl, double %alpha, double %beta, [1800 x double]* nocapture %tmp, [2200 x double]* nocapture readonly %A, [1800 x double]* nocapture readonly %B, [2400 x double]* nocapture readnone %C, [2400 x double]* nocapture readnone %D) local_unnamed_addr #0 {
21 entry:
22   br label %entry.split
24 entry.split:                                      ; preds = %entry
25   br label %for.body
27 for.body:                                         ; preds = %for.inc25, %entry.split
28   %indvars.iv50 = phi i64 [ 0, %entry.split ], [ %indvars.iv.next51, %for.inc25 ]
29   br label %for.body3
31 for.body3:                                        ; preds = %for.inc22, %for.body
32   %indvars.iv46 = phi i64 [ 0, %for.body ], [ %indvars.iv.next47, %for.inc22 ]
33   %arrayidx5 = getelementptr inbounds [1800 x double], [1800 x double]* %tmp, i64 %indvars.iv50, i64 %indvars.iv46
34   store double 0.000000e+00, double* %arrayidx5, align 8, !tbaa !2
35   br label %for.body8
37 for.body8:                                        ; preds = %for.body8, %for.body3
38   %0 = phi double [ 0.000000e+00, %for.body3 ], [ %add, %for.body8 ]
39   %indvars.iv = phi i64 [ 0, %for.body3 ], [ %indvars.iv.next, %for.body8 ]
40   %arrayidx12 = getelementptr inbounds [2200 x double], [2200 x double]* %A, i64 %indvars.iv50, i64 %indvars.iv
41   %1 = load double, double* %arrayidx12, align 8, !tbaa !2
42   %mul = fmul double %1, %alpha
43   %arrayidx16 = getelementptr inbounds [1800 x double], [1800 x double]* %B, i64 %indvars.iv, i64 %indvars.iv46
44   %2 = load double, double* %arrayidx16, align 8, !tbaa !2
45   %mul17 = fmul double %mul, %2
46   %add = fadd double %0, %mul17
47   store double %add, double* %arrayidx5, align 8, !tbaa !2
48   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
49   %exitcond = icmp eq i64 %indvars.iv.next, 2200
50   br i1 %exitcond, label %for.inc22, label %for.body8
52 for.inc22:                                        ; preds = %for.body8
53   %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
54   %exitcond48 = icmp eq i64 %indvars.iv.next47, 1800
55   br i1 %exitcond48, label %for.inc25, label %for.body3
57 for.inc25:                                        ; preds = %for.inc22
58   %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
59   %exitcond52 = icmp eq i64 %indvars.iv.next51, 1600
60   br i1 %exitcond52, label %for.end27, label %for.body
62 for.end27:                                        ; preds = %for.inc25
63   ret void
66 attributes #0 = { norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="haswell" "target-features"="+aes,+avx,+avx2,+bmi,+bmi2,+cmov,+cx16,+f16c,+fma,+fsgsbase,+fxsr,+lzcnt,+mmx,+movbe,+pclmul,+popcnt,+rdrnd,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+xsaveopt,-adx,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512ifma,-avx512pf,-avx512vbmi,-avx512vl,-avx512vpopcntdq,-clflushopt,-clwb,-clzero,-fma4,-lwp,-mwaitx,-pku,-prefetchwt1,-prfchw,-rdseed,-rtm,-sgx,-sha,-sse4a,-tbm,-xop,-xsavec,-xsaves" "unsafe-fp-math"="false" "use-soft-float"="false" }
68 !llvm.module.flags = !{!0}
69 !llvm.ident = !{!1}
71 !0 = !{i32 1, !"wchar_size", i32 4}
72 !1 = !{!"clang version 6.0.0 (trunk 309912) (llvm/trunk 309933)"}
73 !2 = !{!3, !3, i64 0}
74 !3 = !{!"double", !4, i64 0}
75 !4 = !{!"omnipotent char", !5, i64 0}
76 !5 = !{!"Simple C/C++ TBAA"}