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
Optimizer preserves tuple for match failure case #12930
Comments
|
(pasted the wrong code in my previous, now deleted comment). this could be done by a new local optimization, the tuple value only has a single consumer, so it can be inlined / moved (if the arguments don't have side effects). it seems it would also work in this case
as there are local variables (by cfr-decompiler)
cfr-decompiler is a bit confused,
|
Scala.js also suffers from this issue. So far I haven't found a good way to solve it. :( |
Reproduction steps
Scala version: 2.13.12
Problem
Under
-opt:local
, the tuple is not eliminated if it is used for the match error. However, it is always allocated instead of only in the failure case.It would be nice to warn
-Wopt
if a tuple allocation is not eliminated.The text was updated successfully, but these errors were encountered: