RFR: 8312332: C2: Refactor SWPointer out from SuperWord [v3]
Pengfei Li
pli at openjdk.org
Wed Aug 30 11:41:11 UTC 2023
On Thu, 10 Aug 2023 11:58:28 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Pengfei Li has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Move the cache of _pre_loop_end to CountedLoopNode
>
> src/hotspot/share/opto/vectorization.cpp line 145:
>
>> 143: Node* n_c = phase()->get_ctrl(n);
>> 144: return phase()->is_dominator(n_c, pre_loop_end->loopnode());
>> 145: }
>
> Is `pre_loop_end != nullptr` possible here? Before your patch we always found `_slp->pre_loop_head()`.
> I'm just worried that if we do not find it, then we still return `is_not_member`, but `n` is still located in the space between pre and post loop.
> What do you think about this?
>
> And: would it make sense to cache the `pre_loop_head` in the `VPointer`?
Yes, I have found that `pre_loop_end` could be null when we construct `VPointer` in `SuperWord::output()` - see the code in `superword.cpp` (L2574, L2580). It's null because `CountedLoopNode::is_canonical_loop_entry()` returns null at this time. Before my patch, it cannot be null as we cached `_pre_loop_end` in the SuperWord class. To address your concern, my latest commit moves the cache of `_pre_loop_end` from `SuperWord` to `CountedLoopNode`. Some more asserts are also added to make sure it's used for main loops only. (Caching it in `VPointer` doesn't help).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15013#discussion_r1310133543
More information about the hotspot-compiler-dev
mailing list