RFR: 8324790: ifnode::fold_compares_helper cleanup [v2]

Emanuel Peter epeter at openjdk.org
Mon Feb 26 11:42:04 UTC 2024


On Sat, 17 Feb 2024 00:03:21 GMT, Joshua Cao <duke at openjdk.org> wrote:

>> I hope my assumptions  in `filtered_int_type` are correct here:
>> 
>> * we assert that `if_proj` is an `IfTrue` or `IfFalse`, so it is safe to assume `if_proj->_in` is an  `IfNode`
>> * the 1'th input of a CmpNode is a BoolNode
>> * Tthe 1'th input of an IfNode is **not always a BoolNode**, it can be a constant. We need to leave this check in.
>> 
>> We also remove a some of the if-checks in `compare_folds_cleanup` which seem unnecessary.
>> 
>> Passes tier1 locally.
>
> Joshua Cao has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Undo changes in filtered_int_type()
>  - Merge branch 'master' into compare_folds_cleanup
>  - 8324790: ifnode::fold_compares_helper cleanup

I think this generally looks reasonable. I'm running some testing now...

src/hotspot/share/opto/ifnode.cpp line 1029:

> 1027:   }
> 1028: 
> 1029:   Node* hook = new Node(lo); // Add a use to lo to prevent him from dying

Would you mind adding a sanity assert, that both `lo` and `hi` are not `nullptr`?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17601#issuecomment-1963943460
PR Review Comment: https://git.openjdk.org/jdk/pull/17601#discussion_r1502476136


More information about the hotspot-compiler-dev mailing list