RFR(S): 8143542: C2 doesn't eliminate identical checks
Vitaly Davidovich
vitalyd at gmail.com
Thu Feb 11 13:09:19 UTC 2016
Thanks Roland! :)
On Wednesday, February 3, 2016, Roland Westrelin <
roland.westrelin at oracle.com> wrote:
> http://cr.openjdk.java.net/~roland/8143542/webrev.00/
>
> The test case:
>
>
> https://bugs.openjdk.java.net/secure/attachment/55176/RedundantNullCheck.java
>
> has two identical tests one after the other:
>
> int ret = 0;
> if (_i != null) {
> ret += _i.value();
> } else {
> ret += -1;
> }
> if (_i != null) {
> ret += _i.value2();
> } else {
> ret += -1;
> }
>
> They can be merged. I picky backed on the split if code to achieve that.
> Both inlined calls have a null check and a range check. For them to fold
> nicely after the ifs are merged, ConstraintCastNode::dominating_cast()
> needs to more aggressively look for redundant casts.
>
> Roland.
--
Sent from my phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160211/df5432cb/attachment-0001.html>
More information about the hotspot-compiler-dev
mailing list