RFR: 8324751: C2 SuperWord: Aliasing Analysis runtime check [v8]
Emanuel Peter
epeter at openjdk.org
Tue Aug 12 17:07:26 UTC 2025
On Tue, 12 Aug 2025 17:00:54 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Let me try to find an answer here...
>> At least there is an assert in the constructor of `MemPointer`:
>>
>> for (int i = 0; i < summands.length(); i++) {
>> const MemPointerSummand& s = summands.at(i);
>> assert(s.variable() != nullptr, "variable cannot be null");
>> assert(!s.scale().is_NaN(), "non-NaN scale");
>> }
>> for (int i = 0; i < raw_summands.length(); i++) {
>> const MemPointerRawSummand& s = raw_summands.at(i);
>> assert(!s.scaleI().is_NaN(), "non-NaN scale");
>> assert(!s.scaleL().is_NaN(), "non-NaN scale");
>> }
>
> And I think there is already some filtering in `canonicalize_raw_summands`:
>
> // Keep summands with non-zero scale.
> if (!scaleI.is_zero() && !scaleL.is_NaN()) {
> _raw_summands.at_put(pos_put++, MemPointerRawSummand(variable, scaleI, scaleL, int_group));
> }
Ah, but the real work gets done here, in `MemPointer::make`:
if (raw_summands.length() <= RAW_SUMMANDS_SIZE &&
summands.length() <= SUMMANDS_SIZE &&
has_no_NaN_in_con_and_summands(con, summands)) {
return MemPointer(pointer, raw_summands, summands, con, size NOT_PRODUCT(COMMA trace));
} else {
return MemPointer::make_trivial(pointer, size NOT_PRODUCT(COMMA trace));
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24278#discussion_r2270573790
More information about the hotspot-compiler-dev
mailing list