[PATCH] [SLPVectorization] Enhance Ability to Vectorize Horizontal Reductions from Consecutive Loads

Michael Zolotukhin mzolotukhin at apple.com
Sun Dec 21 22:58:03 PST 2014


Hi Suyog,

Yep, I see what you mean. However, to me Left and Right operands look pretty symmetrical, so probably we should either try to make both of them consecutive simultaneously (option a), or make at least one of them consecutive (option b).

For option (a) we need to add a check:

  // We can't make the right operands consecutive - bail out.
  if (!(isConsecutiveAccess(Left[i+1], Right[i+1])))
    continue;

For option (b) we need to change

  if (!(isConsecutiveAccess(Left[i], Right[i])))
    continue;

to

  if (!isConsecutiveAccess(Left[i], Right[i]) && !isConsecutiveAccess(Left[i+1], Right[i+1]))
    // If we can't make any of the pairs consecutive - bail out.
    continue;

I prefer the option (b) here, but if you have any arguments against it, the option (a) is also good.


REPOSITORY
  rL LLVM

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1838
@@ +1837,3 @@
+      return;
+    if (!(isConsecutiveAccess(Left[i], Right[i])))
+      continue;
----------------
Also, braces around isConsecutiveAccess are redundant.

http://reviews.llvm.org/D6675

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list