RFR: 8266854: LibraryCallKit::inline_preconditions_checkIndex modifies control flow even if the intrinsic bailed out [v2]

Vladimir Kozlov kvn at openjdk.java.net
Tue May 11 04:33:55 UTC 2021


On Tue, 11 May 2021 00:57:55 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> src/hotspot/share/opto/library_call.cpp line 1049:
>> 
>>> 1047:     record_for_igvn(rc);
>>> 1048:   }
>>> 1049:   set_control(_gvn.transform(new IfTrueNode(rc)));
>> 
>> Or you can move `stopped()` check here (after `set_control()`) and avoid generation of useless `false` path.
>
> Thanks @vnkozlov for the review. It is this set_control() that is resulting in an assert that control is changed but the intrinsic bailed out. Moving the stopped check right before set_control() would fix the issue. I will update the patch accordingly.

Strange. Actually `BuildCutout` also change control and we have `stopped()` check after it at line #1036.
After that check there is no control change so checking `stopped()` again here looks strange if it helps.
May be this code missing some compile time checks for constants (like TOP) which collapse this graph so we can bailout it without generating code.
Note, the assert is correct - we should not change graph too mach. It should be dead if returns `false` and it will do normal compilation of the bytecode.
Need more information about this case.

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

PR: https://git.openjdk.java.net/jdk/pull/3958


More information about the hotspot-compiler-dev mailing list