RFR: 8343685: C2 SuperWord: refactor VPointer with MemPointer [v6]
Emanuel Peter
epeter at openjdk.org
Thu Jan 16 08:24:54 UTC 2025
On Thu, 16 Jan 2025 06:31:43 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/vectorization.hpp line 1167:
>>
>>> 1165: const VPointer& p1 = s1->vpointer();
>>> 1166: const VPointer& p2 = s2->vpointer();
>>> 1167: bool both_no_invar = p1.count_invar_summands() == 0 &&
>>
>> Since you are using `pointer.count_invar_summands()` multiple times in this class, you could provide a `ConstrainedAlignmentSolution::count_invar_summands()` method directly instead of first fetching the `VPointer` from the solution.
>
> I see 3 occurances. In all cases we have the VPointer fetched anyway. For me it is not worth the extra abstraction, but if you insist on it I can of course do it.
Turns out all usages of `count_invar_summands` are only checks for zero-count. Refactoring it to `has_invar_summands`, but without redirection.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21926#discussion_r1917936204
More information about the hotspot-compiler-dev
mailing list