[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / polly / test / ScheduleOptimizer / GreedyFuse / fuse-except-first.ll
blob185d5c5b8c25ea495737de435824282ae6b848c5
1 ; RUN: opt %loadPolly -polly-reschedule=0 -polly-loopfusion-greedy=1 -polly-postopts=0 -polly-print-opt-isl -disable-output < %s | FileCheck %s --check-prefixes=CHECK,RAW
2 ; RUN: opt %loadPolly -polly-reschedule=1 -polly-loopfusion-greedy=1 -polly-postopts=0 -polly-print-opt-isl -disable-output < %s | FileCheck %s --check-prefixes=CHECK,OPT
4 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B, i32 %k) {
5 entry:
6   br label %for1
9 for1:
10   %j1 = phi i32 [0, %entry], [%j1.inc, %inc1]
11   %j1.cmp = icmp slt i32 %j1, %n
12   br i1 %j1.cmp, label %body1, label %exit1
14     body1:
15       %idx1 = add i32 %j1, %k
16       %arrayidx1 = getelementptr inbounds double, ptr %B, i32 %idx1
17       store double 21.0, ptr %arrayidx1
18       br label %inc1
20 inc1:
21   %j1.inc = add nuw nsw i32 %j1, 1
22   br label %for1, !llvm.loop !1
24 exit1:
25   br label %for2
28 for2:
29   %j2 = phi i32 [0, %exit1], [%j2.inc, %inc2]
30   %j2.cmp = icmp slt i32 %j2, %n
31   br i1 %j2.cmp, label %body2, label %exit2
33     body2:
34       %arrayidx2 = getelementptr inbounds double, ptr %B, i32 %j2
35       store double 42.0, ptr %arrayidx2
36       br label %inc2
38 inc2:
39   %j2.inc = add nuw nsw i32 %j2, 1
40   br label %for2
42 exit2:
43   br label %for3
46 for3:
47   %j3 = phi i32 [0, %exit2], [%j3.inc, %inc3]
48   %j3.cmp = icmp slt i32 %j3, %n
49   br i1 %j3.cmp, label %body3, label %exit3
51     body3:
52       %arrayidx3 = getelementptr inbounds double, ptr %A, i32 %j3
53       store double 84.0, ptr %arrayidx3
54       br label %inc3
56 inc3:
57   %j3.inc = add nuw nsw i32 %j3, 1
58   br label %for3
60 exit3:
61   br label %return
64 return:
65   ret void
69 !1 = distinct !{!1, !2}
70 !2 = !{!"llvm.loop.id", !"Hello World!"}
73 ; CHECK:      Calculated schedule:
74 ; CHECK-NEXT: domain: "[n, k] -> { Stmt_body2[i0] : 0 <= i0 < n; Stmt_body1[i0] : 0 <= i0 < n; Stmt_body3[i0] : 0 <= i0 < n }"
75 ; CHECK-NEXT: child:
76 ; CHECK-NEXT:   sequence:
77 ; CHECK-NEXT:   - filter: "[n, k] -> { Stmt_body1[i0] }"
78 ; CHECK-NEXT:     child:
79 ; RAW-NEXT:         mark: "Loop with Metadata"
80 ; RAW-NEXT:         child:
81 ; CHECK-NEXT:         schedule: "[n, k] -> [{ Stmt_body1[i0] -> [(i0)] }]"
82 ; OPT-NEXT:           permutable: 1
83 ; OPT-NEXT:           coincident: [ 1 ]
84 ; CHECK-NEXT:   - filter: "[n, k] -> { Stmt_body2[i0]; Stmt_body3[i0] }"
85 ; CHECK-NEXT:     child:
86 ; CHECK-NEXT:       schedule: "[n, k] -> [{ Stmt_body2[i0] -> [(i0)]; Stmt_body3[i0] -> [(i0)] }]"
87 ; CHECK-NEXT:       child:
88 ; CHECK-NEXT:         sequence:
89 ; CHECK-NEXT:         - filter: "[n, k] -> { Stmt_body2[i0] }"
90 ; CHECK-NEXT:         - filter: "[n, k] -> { Stmt_body3[i0] }"