RFR: 8298935: fix cyclic dependency bug in create_pack logic in SuperWord::find_adjacent_refs [v7]
Jatin Bhateja
jbhateja at openjdk.org
Tue Feb 21 09:44:33 UTC 2023
On Mon, 20 Feb 2023 19:08:56 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> Thanks @jatin-bhateja . In essence, I am trusting `DepPreds` to give me the correct dependency information. Is that not correct? Do you have an example where `DepPreds` would have a `Load` depend on a `Load`, without a store in between?
>>
>> Also: it seems that `SuperWord::independent_path` does nothing special about RAR, it just follows all dependencies of `DepPreds` recursively. This is what is used in `SuperWord::independent`. So if `DepPreds` could not be trusted, then we have the same issue here.
>>
>> In the end, `find_dependence` should do nothing else but `SuperWord::independent`, except for a whole pack at once, and not only pairwise for two memops.
>
> You are correct Load-Load(RAR) is not captured in dependence graph anyways.
>
> My above comment was in context of scenario b), I verified that newly added find_dependence method will not find any circular intra-pack dependence in this case.
> @jatin-bhateja Ah, I misunderstood. Thanks for clarifying. So you verified that WAR is not an issue? Thanks!
>
> I agree that it should not be an issue. For a `Load -> Store` to block vectorization, we would have to find a dependency path from a `Load -> Store -> Load` (LSL) or a `Store -> Load -> Store` (SLS), since my verification only checks if any of the memops in the pack depend on another memop of the pack (both loads or both stores). But both LSL and SLS have a `Store -> Load` (RAW) and so we cannot vectorize. Do you agree with this argument?
Correct, as long as Load in (Store->Load) not feeding back into any other Store in the same pack.
Without complicating the way I see this is that dependence checking looking for an intra-pack dependency where pack is comprised of isomorphic nodes (loads/stores) does a walk over data pendency edges each memory operation in the pack and if the traversal lands back to one the nodes in the pack it should declare a cyclic dependence.
-------------
PR: https://git.openjdk.org/jdk/pull/12350
More information about the hotspot-compiler-dev
mailing list