C2 SuperWord: VTransformLoopPhiNode::apply set wrong type, led to wrong constant folding of phi

XMLWordPrintable

    • b20

      If the attached test case is run with StressIGVN for a large enough number of iterations, execution fails due to an incorrect result.

      What I observe after superword is that, in the vectorized loop, one node is a StoreI with address of the shape:

      (AddP base (AddP base (Phi#1 ...) (Phi#2 ... ) 16)

      Phi#2 has constant 4 as input 1, and some expression that depends on some other Phi on the backedge. However, Phi#2's type is set to 4 by superword which causes it to constant fold and the store to always write at some fixed offset.

      I reproduce this with:

      $ for i in `seq 100`; do echo $i; ~/jdk-jdk/build/linux-x86_64-server-fastdebug/images/jdk/bin/java -XX:-TieredCompilation -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileOnly=TestBrokenSuperWord::test1 -XX:CompileCommand=dontinline,TestBrokenSuperWord::notInlined -XX:PartialPeelNewPhiDelta=1 -XX:+StressIGVN TestBrokenSuperWord || break; done

      Usually needs fewer than 100 iterations to reproduce but not always.

            Assignee:
            Emanuel Peter
            Reporter:
            Roland Westrelin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: