Do not render trivial variables in DataFlow tests

The reason is that while there are optimizations for them
definition of their state is both rather simple and may be
confusing in testData
This commit is contained in:
Denis Zharkov
2017-09-29 16:42:41 +03:00
parent 477aeef90c
commit edbf360852
24 changed files with 479 additions and 464 deletions
@@ -15,72 +15,72 @@ fun foo(numbers: Collection<Int>) {
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(numbers: Collection<Int>) INIT: in: {} out: {numbers=D}
magic[FAKE_INITIALIZER](numbers: Collection<Int>) -> <v0> INIT: in: {numbers=D} out: {numbers=D}
w(numbers|<v0>) INIT: in: {numbers=D} out: {numbers=ID}
2 mark({ for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } }) INIT: in: {numbers=ID} out: {numbers=ID}
v(numbers: Collection<Int>) INIT: in: {} out: {}
magic[FAKE_INITIALIZER](numbers: Collection<Int>) -> <v0> INIT: in: {} out: {}
w(numbers|<v0>) INIT: in: {} out: {}
2 mark({ for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue } }) INIT: in: {} out: {}
3 r(numbers) -> <v1>
mark(numbers)
call(numbers, iterator|<v1>) -> <v2>
v(i) INIT: in: {numbers=ID} out: {i=D, numbers=ID}
v(i) INIT: in: {} out: {}
L2 [loop entry point]:
L6 [condition entry point]:
mark(numbers) INIT: in: {i=D, numbers=ID} out: {i=D, numbers=ID}
mark(numbers) INIT: in: {} out: {}
call(numbers, hasNext) -> <v3>
jmp?(L3)
mark(numbers)
call(numbers, next) -> <v4>
magic[LOOP_RANGE_ITERATION](numbers|<v4>) -> <v5>
w(i|<v5>) INIT: in: {i=D, numbers=ID} out: {i=ID, numbers=ID}
mark(for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) INIT: in: {i=ID, numbers=ID} out: {i=ID, numbers=ID} USE: in: {numbers=READ} out: {numbers=READ}
w(i|<v5>) INIT: in: {} out: {}
mark(for (i in numbers) { val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue }) INIT: in: {} out: {} USE: in: {} out: {}
L4 [body entry point]:
4 mark({ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) continue })
v(val b: Boolean) INIT: in: {i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
mark(if (1 < 2) { b = false } else { b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
v(val b: Boolean) INIT: in: {} out: {b=D}
mark(if (1 < 2) { b = false } else { b = true }) INIT: in: {b=D} out: {b=D}
r(1) -> <v6>
r(2) -> <v7>
mark(1 < 2)
call(1 < 2, compareTo|<v6>, <v7>) -> <v8>
jf(L7|<v8>)
5 mark({ b = false })
r(false) -> <v9> USE: in: {b=WRITTEN_AFTER_READ, numbers=READ} out: {b=WRITTEN_AFTER_READ, numbers=READ}
w(b|<v9>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ, numbers=READ} out: {b=WRITTEN_AFTER_READ, numbers=READ}
4 jmp(L8) INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ, numbers=READ} out: {b=READ, numbers=READ}
r(false) -> <v9> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b|<v9>) INIT: in: {b=D} out: {b=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
4 jmp(L8) INIT: in: {b=ID} out: {b=ID} USE: in: {b=READ} out: {b=READ}
L7 [else branch]:
5 mark({ b = true }) INIT: in: {b=D, i=ID, numbers=ID} out: {b=D, i=ID, numbers=ID}
r(true) -> <v11> USE: in: {b=WRITTEN_AFTER_READ, numbers=READ} out: {b=WRITTEN_AFTER_READ, numbers=READ}
w(b|<v11>) INIT: in: {b=D, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ, numbers=READ} out: {b=WRITTEN_AFTER_READ, numbers=READ}
5 mark({ b = true }) INIT: in: {b=D} out: {b=D}
r(true) -> <v11> USE: in: {b=WRITTEN_AFTER_READ} out: {b=WRITTEN_AFTER_READ}
w(b|<v11>) INIT: in: {b=D} out: {b=ID} USE: in: {b=READ} out: {b=WRITTEN_AFTER_READ}
L8 ['if' expression result]:
4 merge(if (1 < 2) { b = false } else { b = true }|!<v10>, !<v12>) -> <v13> INIT: in: {b=ID, i=ID, numbers=ID} out: {b=ID, i=ID, numbers=ID} USE: in: {b=READ, numbers=READ} out: {b=READ, numbers=READ}
r(b) -> <v14> USE: in: {numbers=READ} out: {b=READ, numbers=READ}
4 merge(if (1 < 2) { b = false } else { b = true }|!<v10>, !<v12>) -> <v13> INIT: in: {b=ID} out: {b=ID} USE: in: {b=READ} out: {b=READ}
r(b) -> <v14> USE: in: {} out: {b=READ}
mark(use(b))
call(use(b), use|<v14>) -> <v15>
jmp(L6) USE: in: {numbers=READ} out: {numbers=READ}
jmp(L6) USE: in: {} out: {}
- 3 jmp(L2)
L3 [loop exit point]:
L5 [body exit point]:
read (Unit) INIT: in: {i=ID, numbers=ID} out: {i=ID, numbers=ID}
read (Unit) INIT: in: {} out: {}
L1:
1 <END>
error:
<ERROR>
sink:
<SINK> USE: in: {numbers=READ} out: {numbers=READ}
<SINK> USE: in: {} out: {}
=====================
== use ==
fun use(vararg a: Any?) = a
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(vararg a: Any?) INIT: in: {} out: {a=D}
magic[FAKE_INITIALIZER](vararg a: Any?) -> <v0> INIT: in: {a=D} out: {a=D}
w(a|<v0>) INIT: in: {a=D} out: {a=ID}
r(a) -> <v1> INIT: in: {a=ID} out: {a=ID}
v(vararg a: Any?) INIT: in: {} out: {}
magic[FAKE_INITIALIZER](vararg a: Any?) -> <v0> INIT: in: {} out: {}
w(a|<v0>) INIT: in: {} out: {}
r(a) -> <v1> INIT: in: {} out: {}
ret(*|<v1>) L1
L1:
<END>
error:
<ERROR>
sink:
<SINK> USE: in: {a=READ} out: {a=READ}
<SINK> USE: in: {} out: {}
=====================