[jdk19] RFR: 8289127: Apache Lucene triggers: DEBUG MESSAGE: duplicated predicate failed which is impossible

Roland Westrelin roland at openjdk.org
Mon Jul 18 07:10:06 UTC 2022


On Fri, 15 Jul 2022 19:37:50 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Loop predication adds a skeleton predicate for a range check that computes:
>> 
>> (AddL (ConvI2L (MulI (CastII (AddI (OpaqueLoopInit 0) (SubI (OpaqueLoopStride ..) 1))) 7))  ..)
>> 
>> later transformed into:
>> 
>> (AddL (SubL (ConvI2L (LShiftI (CastII (AddI (OpaqueLoopInit 0) (OpaqueLoopStride ..))) 3)) (AddL (ConvI2L (CastII (AddI (OpaqueLoopInit 0) (OpaqueLoopStride ..)))) -1)) ..)
>> 
>> When pre/main/post loops are added, this expression is copied (above
>> the main loop) and updated. The logic performing the copy relies on
>> skeleton_follow_inputs() to find the OpaqueLoopInit nodes and clone it
>> with an updated initial value. Note there are 2 OpaqueLoopInit nodes
>> to update in the transformed expression. But because
>> skeleton_follow_inputs() doesn't include LShiftI only one of the
>> OpaqueLoopInit node is cloned with an updated initial value.
>> 
>> After loop opts are over, the OpaqueLoopInit nodes are replaced by
>> their input which result in this particular case in a predicate that
>> always fails.
>> 
>> The fix is to fix skeleton_follow_inputs() to include LShiftI. I also
>> added verification code to catch similar issues in the future.
>
> Testing results are good.

@vnkozlov @dean-long thanks for the reviews

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

PR: https://git.openjdk.org/jdk19/pull/143


More information about the hotspot-compiler-dev mailing list