You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-out/epfl/test13-stable1.check
+14-8
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,24 @@ free vars: List(Sym(1), Sym(2))
2
2
/*****************************************
3
3
Emitting Generated Code
4
4
*******************************************/
5
-
class staged$0(px3:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px4:Object,px6:scala.virtualization.lms.epfl.test13.SCell[Int]) extends ((Int)=>(Int)) {
5
+
class staged$0(px3:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px4:Object,px6:scala.virtualization.lms.epfl.test13.RCell[Int]) extends ((Int)=>(Int)) {
6
6
def apply(x0:Int): Int = {
7
7
val x1 = x0 + 1
8
8
val x2 = x0 * 2
9
-
val x3 = px3 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable1$1$$anon$1
9
+
val x3 = px3 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable1$1$$anon$2
10
10
val x4 = px4 // static data: <function1>
11
11
val x5 = {import x3._;
12
-
val s1 = infix_lhs(findDefinition(Sym(1)).get).head;
13
-
val s2 = infix_lhs(findDefinition(Sym(2)).get).head;
14
-
reset;x3.nVars=3;compile{(x:Rep[Int]) =>
12
+
val s1 = findDefinition(Sym(1)).map(infix_lhs(_).head).getOrElse(Sym(1));
13
+
val s2 = findDefinition(Sym(2)).map(infix_lhs(_).head).getOrElse(Sym(2));
14
+
x3.reset;x3.nVars=3
15
+
compile{(x:Rep[Int]) =>
15
16
createDefinition(s1,StaticData(x1));
16
17
createDefinition(s2,StaticData(x2));
17
-
val r = x4.asInstanceOf[Rep[Int]=>Rep[Int]](x)
18
-
println(globalDefs); r}}//List(Sym(1), Sym(2))
19
-
val x6 = px6 // static data: SCell(stable)
18
+
val y = x4.asInstanceOf[Rep[Int]=>Rep[Int]](x)
19
+
println("freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable1$1$Prog$2$$anonfun$6$$anonfun$7: List(Sym(1), Sym(2))")
20
+
println(globalDefs)
21
+
y}}//List(Sym(1), Sym(2))
22
+
val x6 = px6 // static data: RCell(stable)
20
23
val x7 = x6.value
21
24
val x8 = x5(x7)
22
25
x8
@@ -27,6 +30,7 @@ x8
27
30
*******************************************/
28
31
29
32
compilation: ok
33
+
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable1$1$Prog$2$$anonfun$6$$anonfun$7: List(Sym(1), Sym(2))
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable1$1$Prog$2$$anonfun$6$$anonfun$7: List(Sym(1), Sym(2))
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable1$1$Prog$2$$anonfun$6$$anonfun$7: List(Sym(1), Sym(2))
Copy file name to clipboardExpand all lines: test-out/epfl/test13-stable2.check
+57-51
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,46 @@
1
1
call with arg 9
2
2
(re) compiling
3
3
free vars: List(Sym(1), Sym(2))
4
-
read value SCell(stable) sym Sym(3)
5
-
compiled Sym(12)
4
+
read value RCell(stable) sym Sym(3)
6
5
/*****************************************
7
6
Emitting Generated Code
8
7
*******************************************/
9
-
class staged$0(px3:scala.virtualization.lms.epfl.test13.SCell[Int],px8:scala.virtualization.lms.epfl.test13.SCell[scala.Function1[Int, Int]],px10:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px11:Object) extends ((Int)=>(Int)) {
8
+
class staged$0(px3:scala.virtualization.lms.epfl.test13.RCell[Int],px5:Int,px9:scala.virtualization.lms.epfl.test13.RCell[scala.Function1[Int, Int]],px11:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px12:Object) extends ((Int)=>(Int)) {
10
9
def apply(x0:Int): Int = {
11
-
val x3 = px3 // static data: SCell(stable)
10
+
val x3 = px3 // static data: RCell(stable)
12
11
val x4 = x3.value
13
-
val x5 = x4 == 1
14
-
val x15 = if (x5) {
12
+
val x5 = px5 // static data: 1
13
+
val x6 = x4 == x5
14
+
val x16 = if (x6) {
15
15
val x1 = x0 + 1
16
16
val x2 = x0 * 2
17
-
val x6 = x1 + x2
18
-
val x7 = 1 * x6
19
-
x7
17
+
val x7 = x1 + x2
18
+
val x8 = 1 * x7
19
+
x8
20
20
} else {
21
-
val x8 = px8 // static data: SCell(code)
22
-
val x9 = x8.set(null)
21
+
val x9 = px9 // static data: RCell(code)
22
+
val x10 = x9.set(null)
23
23
val x1 = x0 + 1
24
24
val x2 = x0 * 2
25
-
val x10 = px10 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable2$1$$anon$2
26
-
val x11 = px11 // static data: <function1>
27
-
val x12 = {import x10._;
28
-
val s4 = infix_lhs(findDefinition(Sym(4)).get).head;
29
-
val s1 = infix_lhs(findDefinition(Sym(1)).get).head;
30
-
val s2 = infix_lhs(findDefinition(Sym(2)).get).head;
31
-
reset;x10.nVars=5;compile{(x:Rep[Int]) =>
25
+
val x11 = px11 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable2$1$$anon$3
26
+
val x12 = px12 // static data: <function1>
27
+
val x13 = {import x11._;
28
+
val s4 = findDefinition(Sym(4)).map(infix_lhs(_).head).getOrElse(Sym(4));
29
+
val s1 = findDefinition(Sym(1)).map(infix_lhs(_).head).getOrElse(Sym(1));
30
+
val s2 = findDefinition(Sym(2)).map(infix_lhs(_).head).getOrElse(Sym(2));
println("freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.StableVarsExp$$anonfun$compPart$1$2$$anonfun$apply$4: List(Sym(4), Sym(1), Sym(2))")
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.StableVarsExp$$anonfun$compPart$1$2$$anonfun$apply$4: List(Sym(4), Sym(1), Sym(2))
class staged$1(px4:Int,px1:Int,px2:Int) extends ((Int)=>(Int)) {
55
-
def apply(x5:Int): Int = {
56
-
val x4 = px4 // static data: 5
58
+
class staged$1(px1:Int,px2:Int) extends ((Unit)=>(Int)) {
59
+
def apply(x5:Unit): Int = {
57
60
val x1 = px1 // static data: 10
58
61
val x2 = px2 // static data: 18
59
62
val x6 = x1 + x2
60
-
val x7 = x4 * x6
63
+
val x7 = 5 * x6
61
64
x7
62
65
}
63
66
}
@@ -70,43 +73,46 @@ compilation: ok
70
73
call with arg 9
71
74
(re) compiling
72
75
free vars: List(Sym(9), Sym(10))
73
-
read value SCell(stable) sym Sym(11)
74
-
compiled Sym(20)
76
+
read value RCell(stable) sym Sym(11)
75
77
/*****************************************
76
78
Emitting Generated Code
77
79
*******************************************/
78
-
class staged$2(px11:scala.virtualization.lms.epfl.test13.SCell[Int],px16:scala.virtualization.lms.epfl.test13.SCell[scala.Function1[Int, Int]],px18:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px19:Object) extends ((Int)=>(Int)) {
80
+
class staged$2(px11:scala.virtualization.lms.epfl.test13.RCell[Int],px13:Int,px17:scala.virtualization.lms.epfl.test13.RCell[scala.Function1[Int, Int]],px19:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px20:Object) extends ((Int)=>(Int)) {
79
81
def apply(x8:Int): Int = {
80
-
val x11 = px11 // static data: SCell(stable)
82
+
val x11 = px11 // static data: RCell(stable)
81
83
val x12 = x11.value
82
-
val x13 = x12 == 2
83
-
val x23 = if (x13) {
84
+
val x13 = px13 // static data: 2
85
+
val x14 = x12 == x13
86
+
val x24 = if (x14) {
84
87
val x9 = x8 + 1
85
88
val x10 = x8 * 2
86
-
val x14 = x9 + x10
87
-
val x15 = 2 * x14
88
-
x15
89
+
val x15 = x9 + x10
90
+
val x16 = 2 * x15
91
+
x16
89
92
} else {
90
-
val x16 = px16 // static data: SCell(code)
91
-
val x17 = x16.set(null)
93
+
val x17 = px17 // static data: RCell(code)
94
+
val x18 = x17.set(null)
92
95
val x9 = x8 + 1
93
96
val x10 = x8 * 2
94
-
val x18 = px18 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable2$1$$anon$2
95
-
val x19 = px19 // static data: <function1>
96
-
val x20 = {import x18._;
97
-
val s12 = infix_lhs(findDefinition(Sym(12)).get).head;
98
-
val s9 = infix_lhs(findDefinition(Sym(9)).get).head;
99
-
val s10 = infix_lhs(findDefinition(Sym(10)).get).head;
100
-
reset;x18.nVars=13;compile{(x:Rep[Int]) =>
97
+
val x19 = px19 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testStable2$1$$anon$3
98
+
val x20 = px20 // static data: <function1>
99
+
val x21 = {import x19._;
100
+
val s12 = findDefinition(Sym(12)).map(infix_lhs(_).head).getOrElse(Sym(12));
101
+
val s9 = findDefinition(Sym(9)).map(infix_lhs(_).head).getOrElse(Sym(9));
102
+
val s10 = findDefinition(Sym(10)).map(infix_lhs(_).head).getOrElse(Sym(10));
println("freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.StableVarsExp$$anonfun$compPart$1$2$$anonfun$apply$4: List(Sym(12), Sym(9), Sym(10))")
class staged$0(px4:scala.virtualization.lms.common.Compile with scala.virtualization.lms.common.StaticDataExp,px5:Object) extends ((Int)=>(Int)) {
6
+
def apply(x0:Int): Int = {
7
+
val x1 = x0 + 1
8
+
val x2 = x0 * 2
9
+
val x3 = x1 + x2
10
+
val x4 = px4 // static data: IR:scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testUnstage$1$$anon$1
11
+
val x5 = px5 // static data: <function1>
12
+
val x6 = {import x4._;
13
+
val s3 = findDefinition(Sym(3)).map(infix_lhs(_).head).getOrElse(Sym(3));
14
+
val s1 = findDefinition(Sym(1)).map(infix_lhs(_).head).getOrElse(Sym(1));
15
+
val s2 = findDefinition(Sym(2)).map(infix_lhs(_).head).getOrElse(Sym(2));
16
+
x4.reset;x4.nVars=4
17
+
compile{(x:Rep[Unit]) =>
18
+
createDefinition(s3,StaticData(x3));
19
+
createDefinition(s1,StaticData(x1));
20
+
createDefinition(s2,StaticData(x2));
21
+
val y = x5.asInstanceOf[Int=>Rep[Int]](x3)
22
+
println("freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testUnstage$1$Prog$1$$anonfun$5$$anonfun$apply$5: List(Sym(3), Sym(1), Sym(2))")
23
+
println(globalDefs)
24
+
y}}//List(Sym(3), Sym(1), Sym(2))
25
+
val x7 = x6.apply(())
26
+
x7
27
+
}
28
+
}
29
+
/*****************************************
30
+
End of Generated Code
31
+
*******************************************/
32
+
33
+
compilation: ok
34
+
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testUnstage$1$Prog$1$$anonfun$5$$anonfun$apply$5: List(Sym(3), Sym(1), Sym(2))
class staged$1(px1:Int,px2:Int) extends ((Unit)=>(Int)) {
40
+
def apply(x4:Unit): Int = {
41
+
val x1 = px1 // static data: 10
42
+
val x2 = px2 // static data: 18
43
+
val x5 = x1 + x2
44
+
val x6 = 28 * x5
45
+
x6
46
+
}
47
+
}
48
+
/*****************************************
49
+
End of Generated Code
50
+
*******************************************/
51
+
52
+
compilation: ok
53
+
784
54
+
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testUnstage$1$Prog$1$$anonfun$5$$anonfun$apply$5: List(Sym(3), Sym(1), Sym(2))
class staged$2(px1:Int,px2:Int) extends ((Unit)=>(Int)) {
60
+
def apply(x4:Unit): Int = {
61
+
val x1 = px1 // static data: 4
62
+
val x2 = px2 // static data: 6
63
+
val x5 = x1 + x2
64
+
val x6 = 10 * x5
65
+
x6
66
+
}
67
+
}
68
+
/*****************************************
69
+
End of Generated Code
70
+
*******************************************/
71
+
72
+
compilation: ok
73
+
100
74
+
freeVars/globalDefs for function of type scala.virtualization.lms.epfl.test13.TestStable$$anonfun$testUnstage$1$Prog$1$$anonfun$5$$anonfun$apply$5: List(Sym(3), Sym(1), Sym(2))
0 commit comments