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
In the examples, lvn.py -p currently fails for this example:
@main {
a: int = const 42;
.lbl:
b: int = id a;
a: int = const 5;
print b;
}
The optimization incorrectly changes the last line to print a.
The problem is the interaction between copy (id) propagation and basic block inputs (i.e., the fact that a is read before it is written in the second block). One annoying but cleanish solution would be to copy a to a fresh variable right as the block begins because it is read before it is written. Another, much less clean solution would be to detect the first overwrite of a and do the renaming at that point, or to somehow avoid doing copy propagation for the id because the value will be clobbered later.
The text was updated successfully, but these errors were encountered:
In the examples,
lvn.py -p
currently fails for this example:The optimization incorrectly changes the last line to
print a
.The problem is the interaction between copy (
id
) propagation and basic block inputs (i.e., the fact thata
is read before it is written in the second block). One annoying but cleanish solution would be to copya
to a fresh variable right as the block begins because it is read before it is written. Another, much less clean solution would be to detect the first overwrite ofa
and do the renaming at that point, or to somehow avoid doing copy propagation for theid
because the value will be clobbered later.The text was updated successfully, but these errors were encountered: