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 16:52:12 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/mempointer.cpp line 85:
>> 
>>> 83:     }
>>> 84:     // Bail out if scale is NaN.
>>> 85:     if (scale.is_NaN()) {
>> 
>> If I understand correctly, then a summand cannot be NaN anymore? Do you still bail out somewhere in raw summands if you encounter NaN?
>
> 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));
    }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24278#discussion_r2270571417


More information about the hotspot-compiler-dev mailing list