[PATCH] D28907: [SLP] Fix for PR30787: Failure to beneficially vectorize 'copyable' elements in integer binary ops.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 08:57:15 PDT 2017


ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1607-1621
+  // Avoid any vectors here that are wider than 2 elements and
+  // with just one real operation and others members are operands
+  // for such operations.
+  unsigned AltOpcode = getAltOpcode(S.Opcode);
+  if (VL.size() > 2) {
+    unsigned SameOrAlt = 0;
+    for (Value *V : VL) {
----------------
I think you can check at the very beginning of this function.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1618-1619
+    }
+    if (SameOrAlt == 1)
+      return;
+  }
----------------
Hmm, not sure about this criteria. Maybe the better one is to have number of operations with the same or alternative opcode > than operations with different opcodes? You'd better to investigate this.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:3649
   }
+
   if (!Bundle->isReady()) {
----------------
Remove this line


https://reviews.llvm.org/D28907





More information about the llvm-commits mailing list