xref: /llvm-project/polly/test/ForwardOpTree/noforward_partial.ll (revision e1f056f692d869708c1898d9d65a69ac5584a0ed)
1; RUN: opt %loadNPMPolly '-passes=print<polly-optree>' -disable-output < %s | FileCheck %s -match-full-lines
2;
3; Not the entire operand tree can be forwarded,
4; some scalar dependencies would remain.
5;
6; for (int j = 0; j < n; j += 1) {
7; bodyA:
8;   double val = f() + 21.0;
9;
10; bodyB:
11;   A[0] = val;
12; }
13;
14declare double @f(...) #1
15
16define void @func(i32 %n, ptr noalias nonnull %A) {
17entry:
18  br label %for
19
20for:
21  %j = phi i32 [0, %entry], [%j.inc, %inc]
22  %j.cmp = icmp slt i32 %j, %n
23  br i1 %j.cmp, label %bodyA, label %exit
24
25    bodyA:
26      %v = call double (...) @f()
27      %val = fadd double %v, 21.0
28      br label %bodyB
29
30    bodyB:
31      store double %val, ptr %A
32      br label %inc
33
34inc:
35  %j.inc = add nuw nsw i32 %j, 1
36  br label %for
37
38exit:
39  br label %return
40
41return:
42  ret void
43}
44
45attributes #1 = { nounwind readnone }
46
47
48; CHECK: ForwardOpTree executed, but did not modify anything
49