Chromium Code Reviews
DescriptionRerun GVN if load elimination creates GVN candidates.
This does not fire often but is occasionally useful. e.g
t3 = t2._collection$_length;
if (t3 === 0)
timer = null;
else {
if (t3 === 0)
H.throwExpression(new P.StateError("No such element"));
timer = t2._collection$_first;
}
-->
if (t2._collection$_length === 0)
timer = null;
else
timer = t2._collection$_first;
After load-elimination creates t3 = t2._collections$_length, t3 == 0 becomes a GVN candidate. Then the inner "x" in "if (x) ... else { if (x) ... }" is replaced by "false".
The original code was something like "timer = t2.isEmpty ? null : t2.first".
BUG=
R=sigmund@google.com
Committed: https://github.com/dart-lang/sdk/commit/d6e324f0565b54d500987262821069dde498b584
Patch Set 1 #Patch Set 2 : dartfmt #Messages
Total messages: 7 (4 generated)
|