[PATCH] [SLPVectorization] Enhance Ability to Vectorize Horizontal Reductions from Consecutive Loads
Michael Zolotukhin
mzolotukhin at apple.com
Wed Jan 7 17:18:51 PST 2015
Hi Suyog,
Happy New Year!
Thanks for the detailed explanation! I think that since the current algorithm always works locally, and sees only two left and two right operands (since we start from BinOp), we should confine
`reorderIfConsecutiveLoads` to size=2. That could be done either by unrolling the loop, or by adding assertion+comment at the beginning. I prefer getting rid of the loop now, because the current approach targets a very specific case and isn't intended to be general, while the presence of the loop made me think that it's more or less general, which is misleading. We should either do a general approach, or confine ourselves with the specific particular case. Hopefully in future we'll implement a general algorithm for handling big reductions.
And one more nit: we can enable this for floats too, when fast-math is on. You can find an example of how it could be done in LoopVectorizer.cpp:5251.
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