RFR: 8298935: fix cyclic dependency bug in create_pack logic in SuperWord::find_adjacent_refs [v7]
Jatin Bhateja
jbhateja at openjdk.org
Mon Feb 20 19:11:31 UTC 2023
On Mon, 20 Feb 2023 11:09:10 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/superword.cpp line 1394:
>>
>>> 1392: for (DepPreds preds(n, _dg); !preds.done(); preds.next()) {
>>> 1393: Node* pred = preds.current();
>>> 1394: if (in_bb(pred) && depth(pred) >= min_d) {
>>
>> Hi @eme64 , Dependency captures three scenarios :-
>> a) RAW(ture) : Store -> Load
>> b) WAR(anti) : Load -> Store
>> c) WAW : Store -> Store.
>> RAR is a non-dependency. Existing routine independent_path is called during statement packing after its certain that statements are isomorphic. Newly added find_dependence routine optimizes the dependency checking but it does not seem to be skipping over anti-dependence checks which may prevent vectorization in some cases. Can you share your thoughts on this.
>
> 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.
-------------
PR: https://git.openjdk.org/jdk/pull/12350
More information about the hotspot-compiler-dev
mailing list