I have found a Test.java, where we have independency on pair and pack level.
The nodes in a pack are all mutually independent (none have a path to any other of them).
But: the packs have cyclic dependencies between them.
When this is SuperWord-vectorized, it leads to wrong results, operations are reordered that should not be reordered.
Regression Test.java
./java -XX:CompileCommand=compileonly,Test::test -Xbatch -XX:+TraceSuperWord -XX:+TraceNewVectors Test.java
I found this during the work of JDK-8298935. The bugs are related, but not the same. JDK-8298935 did not properly verify that the packs were independent.
But independence on pack level is not sufficient, there can still be cyclic dependencies between the packs. This bug here reveals this.
It seems that we missed out on this, even though the SuperWord paper mentions that one has to be careful about cyclic dependencies between the (independent) packs.
See
https://groups.csail.mit.edu/cag/slp/SLP-PLDI-2000.pdf
(3.7 Scheduling)
See also my explanations in the PR of JDK-8298935:
https://github.com/openjdk/jdk/pull/12350#issuecomment-1465860465