A DESCRIPTION OF THE PROBLEM :
`x + (con - y) -> (x - y) + con` is a widely seen pattern; however it is missing in current implementation, which prevents some obvious constant folding from happening, such as `x + (1 - y) + 2` will be not optimized at all, rather than into `x - y + 3`.
A pull request has been created: https://github.com/openjdk/jdk/pull/7795
`x + (con - y) -> (x - y) + con` is a widely seen pattern; however it is missing in current implementation, which prevents some obvious constant folding from happening, such as `x + (1 - y) + 2` will be not optimized at all, rather than into `x - y + 3`.
A pull request has been created: https://github.com/openjdk/jdk/pull/7795
- relates to
-
JDK-8281453 New optimization: convert ~x into -1-x when ~x is used in an arithmetic expression
-
- Resolved
-