RFR: 8365570: C2 fails assert(false) failed: Unexpected node in SuperWord truncation: CastII
Emanuel Peter
epeter at openjdk.org
Thu Aug 21 06:21:55 UTC 2025
On Wed, 20 Aug 2025 22:16:36 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:
>> src/hotspot/share/opto/superword.cpp line 2576:
>>
>>> 2574:
>>> 2575: // Vector nodes and casts should not truncate.
>>> 2576: if (type->isa_vect() != nullptr || type->isa_vectmask() != nullptr || in->is_Reduction() || in->is_ConstraintCast()) {
>>
>> Why should we not truncate a CastII? What can go wrong?
>
> My thinking was that since casts specifically change the type of a node, they may not be safe to truncate. In practice it might not matter because after the CastII pack is created, it's discarded because there is no backend implementation for vectorized CastII. I've opted to mark them as non-truncating to stay on the safer side.
I see. Ok. Can you add a comment to the code for that?
Because imagine we come along later and actually implement a backend vectorized version of CastII (no-op?). Maybe because we implement if-conversion. Then it would be nice to know if this was just a "to be on the safe side" check, or if it would run into issues when removed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26827#discussion_r2289964681
More information about the hotspot-compiler-dev
mailing list