RFR: 8257625: C2: Harden input checks in vector intrinsics

Vladimir Kozlov kvn at openjdk.java.net
Thu Dec 3 00:43:58 UTC 2020


On Wed, 2 Dec 2020 23:56:48 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

> > Starting code and checks in vectorIntrinsics.cpp intrinsics is very repetitive.
> > Is it possible to facto it into one for some of them?
> 
> Yes, I agree. I have some ideas on how to improve the situation, but want to address it as a separate enhancement.
> In this PR I'd like to focus on fixing the bug.

I am fine with doing it as separate RFE.

>> src/hotspot/share/opto/vectorIntrinsics.cpp line 326:
>> 
>>> 324:   if (shuffle_klass == NULL || vlen == NULL || start_val == NULL || step_val == NULL || wrap == NULL) {
>>> 325:     return false; // dead code
>>> 326:   }
>> 
>> Should you also print some intrinsic message for following check?
>
> I don't think it's needed. That's effectively dead code and the message won't provide any actionable information.

I actually asked it not for this dead code but for *following* check for constants. I could not select it because stupid GH  UI.  You print message in previous intrinsic in such case.

>> src/hotspot/share/opto/vectornode.cpp line 195:
>> 
>>> 193:     // Unimplemented for subword types since bit count changes
>>> 194:     // depending on size of lane (and sign bit).
>>> 195:     return 0;
>> 
>> Above comment should be changes.
>
> Do you think so? It is related to `PopCountI`, precedes `(bt == T_INT)` check and clearly states it's about subword types.

Okay. Yes, it is still valid.

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

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


More information about the hotspot-compiler-dev mailing list