8200477: Integer dot product no longer autovectorised
authorroland
Tue, 24 Apr 2018 09:35:08 +0200
changeset 49870 1da3a463a499
parent 49869 c71f40e37583
child 49871 3325ee1c0fc4
8200477: Integer dot product no longer autovectorised Reviewed-by: kvn
src/hotspot/share/opto/superword.cpp
--- a/src/hotspot/share/opto/superword.cpp	Fri Apr 20 09:44:24 2018 +0200
+++ b/src/hotspot/share/opto/superword.cpp	Tue Apr 24 09:35:08 2018 +0200
@@ -1943,9 +1943,14 @@
         for (uint k = 0; k < use->req(); k++) {
           Node* n = use->in(k);
           if (def == n) {
-            // reductions can be loop carried dependences
-            if (def->is_reduction() && use->is_Phi())
+            // reductions should only have a Phi use at the the loop
+            // head and out of loop uses
+            if (def->is_reduction() &&
+                ((use->is_Phi() && use->in(0) == _lpt->_head) ||
+                 !_lpt->is_member(_phase->get_loop(_phase->ctrl_or_self(use))))) {
+              assert(i == p->size()-1, "must be last element of the pack");
               continue;
+            }
             if (!is_vector_use(use, k)) {
               return false;
             }