FIR CFG: merge data flow if called-in-place lambda may not be called

This commit is contained in:
pyos
2022-06-30 11:26:32 +02:00
committed by Dmitriy Novozhilov
parent 06c7572ee5
commit 5a2ec4a0d5
23 changed files with 594 additions and 129 deletions
@@ -45,88 +45,94 @@ digraph atLeastOnce_kt {
13 [label="Postponed enter to lambda"];
subgraph cluster_6 {
color=blue
20 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
21 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_7 {
color=blue
21 [label="Enter block"];
22 [label="Const: Int(1)"];
23 [label="Assignment: R|<local>/x|"];
24 [label="Exit block"];
22 [label="Enter block"];
23 [label="Const: Int(1)"];
24 [label="Assignment: R|<local>/x|"];
25 [label="Exit block"];
}
25 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
26 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
14 [label="Postponed exit from lambda"];
15 [label="Function call: R|/inlineRun|(...)"];
16 [label="Access variable R|<local>/x|"];
17 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
18 [label="Exit block"];
14 [label="Call arguments union" style="filled" fillcolor=yellow];
15 [label="Postponed exit from lambda"];
16 [label="Function call: R|/inlineRun|(...)"];
17 [label="Access variable R|<local>/x|"];
18 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
19 [label="Exit block"];
}
19 [label="Exit function test_1" style="filled" fillcolor=red];
20 [label="Exit function test_1" style="filled" fillcolor=red];
}
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {20};
13 -> {14} [color=red];
13 -> {20} [style=dashed];
14 -> {15};
15 -> {16};
13 -> {21};
13 -> {15} [color=red];
13 -> {21} [style=dashed];
14 -> {16} [color=red];
15 -> {16} [color=green];
16 -> {17};
17 -> {18};
18 -> {19};
20 -> {21};
19 -> {20};
21 -> {22};
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {14} [color=green];
25 -> {20} [color=green style=dashed];
25 -> {26};
26 -> {14} [color=red];
26 -> {15} [color=green];
26 -> {21} [color=green style=dashed];
subgraph cluster_8 {
color=red
26 [label="Enter function test_2" style="filled" fillcolor=red];
27 [label="Enter function test_2" style="filled" fillcolor=red];
subgraph cluster_9 {
color=blue
27 [label="Enter block"];
28 [label="Variable declaration: lval x: R|kotlin/Int|"];
29 [label="Postponed enter to lambda"];
28 [label="Enter block"];
29 [label="Variable declaration: lval x: R|kotlin/Int|"];
30 [label="Postponed enter to lambda"];
subgraph cluster_10 {
color=blue
36 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
38 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_11 {
color=blue
37 [label="Enter block"];
38 [label="Const: Int(1)"];
39 [label="Assignment: R|<local>/x|"];
40 [label="Exit block"];
39 [label="Enter block"];
40 [label="Const: Int(1)"];
41 [label="Assignment: R|<local>/x|"];
42 [label="Exit block"];
}
41 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
43 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
30 [label="Postponed exit from lambda"];
31 [label="Function call: R|/myRun|(...)"];
32 [label="Access variable R|<local>/x|"];
33 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
34 [label="Exit block"];
31 [label="Call arguments union" style="filled" fillcolor=yellow];
32 [label="Postponed exit from lambda"];
33 [label="Function call: R|/myRun|(...)"];
34 [label="Access variable R|<local>/x|"];
35 [label="Function call: R|<local>/x|.R|kotlin/Int.inc|()"];
36 [label="Exit block"];
}
35 [label="Exit function test_2" style="filled" fillcolor=red];
37 [label="Exit function test_2" style="filled" fillcolor=red];
}
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {36};
29 -> {30} [color=red];
29 -> {36} [style=dashed];
30 -> {31};
31 -> {32};
32 -> {33};
29 -> {30};
30 -> {38};
30 -> {32} [color=red];
30 -> {38} [style=dashed];
31 -> {33} [color=red];
32 -> {33} [color=green];
33 -> {34};
34 -> {35};
35 -> {36};
36 -> {37};
37 -> {38};
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {30} [color=green];
41 -> {36} [color=green style=dashed];
41 -> {42};
42 -> {43};
43 -> {31} [color=red];
43 -> {32} [color=green];
43 -> {38} [color=green style=dashed];
}
@@ -66,8 +66,7 @@ digraph atMostOnce_kt {
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {20};
13 -> {14} [color=red];
13 -> {14 20};
13 -> {20} [style=dashed];
14 -> {15};
15 -> {16};
@@ -79,7 +78,7 @@ digraph atMostOnce_kt {
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {14} [color=green];
25 -> {14};
subgraph cluster_8 {
color=red
@@ -112,8 +111,7 @@ digraph atMostOnce_kt {
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {36};
29 -> {30} [color=red];
29 -> {30 36};
29 -> {36} [style=dashed];
30 -> {31};
31 -> {32};
@@ -125,6 +123,6 @@ digraph atMostOnce_kt {
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {30} [color=green];
41 -> {30};
}
@@ -76,8 +76,7 @@ digraph inPlaceLambda_kt {
15 -> {16};
16 -> {17};
17 -> {18};
18 -> {23};
18 -> {19} [color=red];
18 -> {19 23};
18 -> {23} [style=dashed];
19 -> {20};
20 -> {21};
@@ -86,6 +85,6 @@ digraph inPlaceLambda_kt {
24 -> {25};
25 -> {26};
26 -> {27};
27 -> {19} [color=green];
27 -> {19};
}
@@ -66,8 +66,7 @@ digraph unknown_kt {
10 -> {11};
11 -> {12};
12 -> {13};
13 -> {20};
13 -> {14} [color=red];
13 -> {14 20};
13 -> {20} [style=dashed];
14 -> {15};
15 -> {16};
@@ -79,7 +78,7 @@ digraph unknown_kt {
22 -> {23};
23 -> {24};
24 -> {25};
25 -> {14} [color=green];
25 -> {14};
25 -> {20} [color=green style=dashed];
subgraph cluster_8 {
@@ -113,8 +112,7 @@ digraph unknown_kt {
26 -> {27};
27 -> {28};
28 -> {29};
29 -> {36};
29 -> {30} [color=red];
29 -> {30 36};
29 -> {36} [style=dashed];
30 -> {31};
31 -> {32};
@@ -126,7 +124,7 @@ digraph unknown_kt {
38 -> {39};
39 -> {40};
40 -> {41};
41 -> {30} [color=green];
41 -> {30};
41 -> {36} [color=green style=dashed];
}