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

Michael Zolotukhin mzolotukhin at apple.com
Tue Dec 23 15:51:16 PST 2014


Hi Suyog,

Thanks for the links to the previous discussions.

Sizes of Left and Right equal 2 only for the trees with depth 2, right (i.e. only for sum of 4 operands, like in our previous examples)? That's not true for sum of 8 operands, for which we have a deeper tree. So, if I'm not totally confused here, unrolling the loop would mean that we only handle 4-operands sums, which doesn't look better than your original code. So, I'd prefer to keep the loop.

However, I'm still thinking if it's possible to solve the problem in a more general way. E.g. sort the operands basing on their index from the same base pointer, and then distribute them between Left and Right arrays to get maximum number of consecutive pairs. What do you think, is it doable? And if so, will it catch any useful case that the current approach doesn't catch? By the way, I totally agree that the example from my previous letter is quite artificial, and maybe it's ok if we give up on it. And if a general solution would bring a lot of complexity to the code, I'd rather go with you current implementation.

Thanks,
Michael

PS: My answers might be delayed during the Christmas season, but I'll get back to the discussion as soon as I can.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6675

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






More information about the llvm-commits mailing list