RFR: 8334647: C2: CastII added by PhaseIdealLoop::add_template_assertion_predicate() should have control [v2]

Roland Westrelin roland at openjdk.org
Thu Jul 25 07:18:36 UTC 2024


On Wed, 26 Jun 2024 07:08:21 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>>> Just thought about it again. What about ensuring that all `ConstraintCastNode` always set a control? I've had a quick look and it seems that we only have one `CastPP` where we do not set a control input. AFAICT, all other nodes set a control:
>>> 
>>> https://github.com/openjdk/jdk/blob/ca5a438e5a4612c66f70c70a9d425eca0e49e84d/src/hotspot/share/opto/vector.cpp#L491
>> 
>> Mandating control on all `ConstraintCastNode` sounds reasonable but I have no idea what control would make sense for the case above so maybe it's too constraining to always have to set the control.
>
>> Mandating control on all `ConstraintCastNode` sounds reasonable but I have no idea what control would make sense for the case above so maybe it's too constraining to always have to set the control.
> 
> Maybe it is, I'm not sure about this case, either. But if this is the only case we could think about just adding the same assert you've inserted for `CastII/LL` at the other `ConstraintCastNodes` (except for `CastPP` due to this unclear case). What do you think about that? This could ensure that if someone is adding any such node without control, they need a good reason to not add a control instead of the other way round.

@chhagedorn thanks for the review. @vnkozlov still good?

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

PR Comment: https://git.openjdk.org/jdk/pull/19808#issuecomment-2249622964


More information about the hotspot-compiler-dev mailing list