150
|
1 ; RUN: opt %loadPolly -polly-optree -analyze < %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 ;
|
|
14 declare double @f(...) #1
|
|
15
|
|
16 define void @func(i32 %n, double* noalias nonnull %A) {
|
|
17 entry:
|
|
18 br label %for
|
|
19
|
|
20 for:
|
|
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, double* %A
|
|
32 br label %inc
|
|
33
|
|
34 inc:
|
|
35 %j.inc = add nuw nsw i32 %j, 1
|
|
36 br label %for
|
|
37
|
|
38 exit:
|
|
39 br label %return
|
|
40
|
|
41 return:
|
|
42 ret void
|
|
43 }
|
|
44
|
|
45 attributes #1 = { nounwind readnone }
|
|
46
|
|
47
|
|
48 ; CHECK: ForwardOpTree executed, but did not modify anything
|