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

Hui Shi hshi at openjdk.java.net
Mon Jul 12 10:49:58 UTC 2021


On Mon, 5 Jul 2021 08:47:58 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> 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.

@rwestrel sorry for late update, I did detail checks about how opaque1 get cloned in loop optimization. Preventing split-thru-phi with an opaque input doesn't work in my investigation.

![image](https://user-images.githubusercontent.com/70356247/125274735-d4a61b80-e340-11eb-9b78-ed2d87987c43.png)
IdealGraph in http://cr.openjdk.java.net/~hshi/8269820/loop_unroll.xml

1. Opaque1 node is not split in split_thru_phi, it is split when split if in split_up.
2. Entire split is triggered by Split if on if node 415
3. Split starts at region node 210 and phi node 213, PhaseIdealLoop::split_up from 213->492->497(recursive to 516)->516->499->458
4. If disable split 458 in PhaseIdealLoop::split_up, it will crash with other assertions, because "do_split_if" expects "have no instructions in the block containing the IF".

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

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


More information about the hotspot-compiler-dev mailing list