RFR: 8334647: C2: CastII added by PhaseIdealLoop::add_template_assertion_predicate() should have control
Christian Hagedorn
chagedorn at openjdk.org
Mon Jun 24 06:36:13 UTC 2024
On Fri, 21 Jun 2024 13:34:41 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> > Are there other places where a `CastII` is currently without control input? If so, should we fix those as well?
>
> I found this one with manual inspection:
>
> https://github.com/rwestrel/jdk/blob/b05cf955d68034ba014cc63486797876d492ca5f/src/hotspot/share/opto/loopTransform.cpp#L3007
>
> And, yes I think it should have a control because if it's narrowing its input type, then it has to be dependent on some condition.
Okay, this looks similar the the case in the current patch. Maybe we can also fix this now?
> There are also 2 in `LibraryCallKit::inline_vector_insert()` but I'm not sure what to do with these ones.
Hm okay, hard to tell. But are these `CastII` nodes even required? Can't we just set the type of the `ConvL2I` directly to `TypeInt::BYTE` and `TypeInt::SHORT`?
https://github.com/openjdk/jdk/blob/863b2a991df9204560c4680fc10dd0f68b260217/src/hotspot/share/opto/vectorIntrinsics.cpp#L2487-L2492
Looking at the history, it seems that the code was added when `ConvL2I` was still a non-type node.
Given that we could get rid of those two in `inline_vector_insert()` and only ending up with `CastII` nodes with a control input, we maybe want to force users to always set the control input. What do you think?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19808#issuecomment-2185718556
More information about the hotspot-compiler-dev
mailing list