[jdk17] RFR: 8269820: C2 PhaseIdealLoop::do_unroll get wrong opaque node [v2]

Roland Westrelin roland at openjdk.java.net
Mon Jul 5 08:50:52 UTC 2021


On Mon, 5 Jul 2021 01:31:33 GMT, Hui Shi <hshi at openjdk.org> wrote:

>> In PhaseIdealLoop::is_canonical_loop_entry check, opaque node can be at either input of compare node, after is_canonical_loop_entry check, opaq node is getting only from compare node's in(2). This might get wrong oqaque node and cause crash/assertion.  Detailed crash and analysis is in JBS.
>> 
>> Fix: Adding method PhaseIdealLoop::get_opaque_from_cmp, getting opaque node from cmp node's either input.
>> 
>> Test: Linux X64 tier1/2/3 release/fastdebug no regression.
>> 
>> After this fix, BoolNode::Ideal might remove its code forbidding swapping compare node's input node order when second one is opaque1 node.
>
> Hui Shi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix more places assumption opaque at second input of compare nodes

Have you considered preventing split-thru-phi with an opaque input? That would be a better fix IMO.

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

PR: https://git.openjdk.java.net/jdk17/pull/208


More information about the hotspot-compiler-dev mailing list