New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement copy propagation #25
Labels
Comments
lrytz
added a commit
to lrytz/scala
that referenced
this issue
Nov 6, 2015
Copy propagation uses an AliasingAnalyzer: it replaces a `LOAD n` instruction by `LOAD m` where m is the smallest alias of n. This leads to stale STORE instructions. Stale STOREs are identified using a ProdCons analyzer and replaced by POPs. Values that are pushed on the stack by a side-effect free instruction and consumed by a POP are then removed by `eliminatePushPop`. This includes elimination of unused closure allocations and unused boxes and tuple allocations (*). A final cleanup eliminates `STORE x; LOADx` pairs where the stored value is not otherwise used. Fixes - scala/scala-dev#25 - scala/scala-dev#7 - scala/scala-dev#14 - scala/scala-dev#12 (*) We don't yet rewrite reads of boxes and tuples yet. For example, `val x = (1, 2); x._1` remains a method invocation and the tuple cannot be eliminated (scala/scala-dev#11). Inspired in many ways by Miguel's work!
lrytz
added a commit
to lrytz/scala
that referenced
this issue
Nov 10, 2015
Copy propagation uses an AliasingAnalyzer: it replaces a `LOAD n` instruction by `LOAD m` where m is the smallest alias of n. This leads to stale STORE instructions. Stale STOREs are identified using a ProdCons analyzer and replaced by POPs. Values that are pushed on the stack by a side-effect free instruction and consumed by a POP are then removed by `eliminatePushPop`. This includes elimination of unused closure allocations and unused boxes and tuple allocations (*). A final cleanup eliminates `STORE x; LOADx` pairs where the stored value is not otherwise used. Fixes - scala/scala-dev#25 - scala/scala-dev#7 - scala/scala-dev#14 - scala/scala-dev#12 (*) We don't yet rewrite reads of boxes and tuples yet. For example, `val x = (1, 2); x._1` remains a method invocation and the tuple cannot be eliminated (scala/scala-dev#11). Inspired in many ways by Miguel's work!
lrytz
added a commit
to lrytz/scala
that referenced
this issue
Nov 10, 2015
Copy propagation uses an AliasingAnalyzer: it replaces a `LOAD n` instruction by `LOAD m` where m is the smallest alias of n. This leads to stale STORE instructions. Stale STOREs are identified using a ProdCons analyzer and replaced by POPs. Values that are pushed on the stack by a side-effect free instruction and consumed by a POP are then removed by `eliminatePushPop`. This includes elimination of unused closure allocations and unused boxes and tuple allocations (*). A final cleanup eliminates `STORE x; LOADx` pairs where the stored value is not otherwise used. Fixes - scala/scala-dev#25 - scala/scala-dev#7 - scala/scala-dev#14 - scala/scala-dev#12 (*) We don't yet rewrite reads of boxes and tuples yet. For example, `val x = (1, 2); x._1` remains a method invocation and the tuple cannot be eliminated (scala/scala-dev#11). Inspired in many ways by Miguel's work!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Miguel's code: https://github.com/lrytz/scala/blob/opt/rebaseWip/src/compiler/scala/tools/nsc/backend/bcode/CopyPropagator.java
creates stale local variables that can be eliminated (#7)
The text was updated successfully, but these errors were encountered: