RFR: 8264020: Optimize double negation elimination [v2]
Eric Liu
github.com+10482586+therealeliu at openjdk.java.net
Tue Mar 30 01:56:55 UTC 2021
> For the double negation '-(-x)', c2 could reduce the redundant 'sub'
> through SubNode::Ideal. But every time when 'sub' is removed, there
> would generate two useless nodes SubNode(x, 0)[1] and AddNode(x, -0)[2],
> which would be removed by later phases but should have optimized better
> to 'x' itself without generating those new stuffs.
>
> This patch is a small fix for SubNode's Ideal, by leaving this special
> case to 'Identity' which handled double negation already[3].
>
> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/subnode.cpp#L238
> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/subnode.cpp#L181
> [3] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/subnode.cpp#L55
Eric Liu has updated the pull request incrementally with one additional commit since the last revision:
update code style
Change-Id: I4c8f67f6277ded894af2572ff89b6b08f9187e11
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/3231/files
- new: https://git.openjdk.java.net/jdk/pull/3231/files/934fe11d..d553a680
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3231&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3231&range=00-01
Stats: 6 lines in 1 file changed: 2 ins; 0 del; 4 mod
Patch: https://git.openjdk.java.net/jdk/pull/3231.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3231/head:pull/3231
PR: https://git.openjdk.java.net/jdk/pull/3231
More information about the hotspot-compiler-dev
mailing list