Skip to content

Constant-fold unary operations in Typer #4614

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

Merged
merged 2 commits into from
Jun 4, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 2, 2018

This was previously forgotten, even though unary operations such as ! and ~ were folded later
in FirstTransform. As a consequence, inlining simplifications involving constant expressions
using these operations were not done. This affected in particular the trace macro, which was always
expanded to an operation taking a closure argument.

odersky added 2 commits June 2, 2018 15:23
This was previously forgotten, even though unary operations such as `!` and `~` were folded later
in FirstTransform. As a consequence, inlining simplifications involving constant expressions
using these operations were not done. This affected in particular the trace macro, which was always
expanded to an operation taking a closure argument.
@odersky
Copy link
Contributor Author

odersky commented Jun 2, 2018

test performance please

@dottybot
Copy link
Member

dottybot commented Jun 2, 2018

performance test scheduled: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

dottybot commented Jun 2, 2018

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/4614/ to see the changes.

Benchmarks is based on merging with master (868d199)

@nicolasstucki
Copy link
Contributor

@odersky could you give some example of code that does not get optimized with !.

@odersky
Copy link
Contributor Author

odersky commented Jun 3, 2018

@nicolasstucki No application of trace was optimized. That's how I found out.

@odersky odersky merged commit dc5c343 into scala:master Jun 4, 2018
@Blaisorblade Blaisorblade deleted the change-constfold-unary branch June 4, 2018 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants